`

myeclipse之不能部署问题(Undefined exploded archive location)

阅读更多
参考资料
1 ECLIPSE中部署工程报“Undefined exploded archive location”错误的解决方法
http://blog.csdn.net/jojoy_828/article/details/2050728
2 Undefined exploded archive location 错误 
http://ljhzzyx.blog.163.com/blog/static/38380312201010923129855/
http://www.blogjava.net/hulizhong/archive/2008/06/20/209502.html
原因:在工程转移过程中,导致工程的配置文件出错
部署错误情况一
1 在myeclipse配置的server中不能部署工程,报错如下:
no projects are  available for deployment to this server Either the all have already been deployed to this server or no deployable projects have been found
报错图片如下:

说明一下,我的工程类型为J2EE1.3,编译语法为1.4,检查工程的相关文件,其中的.project文件内容如下
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
	<name>XXXX</name>
	<comment></comment>
	<projects>
	</projects>
	<buildSpec>
		<buildCommand>
			<name>com.genuitec.eclipse.j2eedt.core.WebClasspathBuilder</name>
			<arguments>
			</arguments>
		</buildCommand>
		<buildCommand>
			<name>org.eclipse.jdt.core.javabuilder</name>
			<arguments>
			</arguments>
		</buildCommand>
		<buildCommand>
			<name>com.genuitec.eclipse.j2eedt.core.J2EEProjectValidator</name>
			<arguments>
			</arguments>
		</buildCommand>
		<buildCommand>
			<name>com.genuitec.eclipse.j2eedt.core.DeploymentDescriptorValidator</name>
			<arguments>
			</arguments>
		</buildCommand>
		<buildCommand>
			<name>org.eclipse.wst.validation.validationbuilder</name>
			<arguments>
			</arguments>
		</buildCommand>
		<buildCommand>
			<name>com.genuitec.eclipse.ast.deploy.core.DeploymentBuilder</name>
			<arguments>
			</arguments>
		</buildCommand>
	</buildSpec>
	<natures>
		<nature>com.genuitec.eclipse.j2eedt.core.webnature</nature>
		<nature>org.eclipse.jdt.core.javanature</nature>
	</natures>
</projectDescription>

你也许会问,如何查看这个.project文件呢,有二种方法,一种是在物理磁盘上你的工程下面
第二种是在Eclipse中,如下图所示
点击Package Explorer右边的下拉小三角

点击Filters...

把框中第一个复选框勾选取消(.resources)

3 点击确定后就可在工程中查看到.project文件了
4 你可根据工程的使用的版本,创建相应的工程,将其中的.project文件内容拷贝过去
如下,我创建的是J2EE1.3的版本,粘贴至相应的位置,内容如下:
<buildSpec>
		<buildCommand>
			<name>com.genuitec.eclipse.j2eedt.core.WebClasspathBuilder</name>
			<arguments>
			</arguments>
		</buildCommand>
		<buildCommand>
			<name>org.eclipse.jdt.core.javabuilder</name>
			<arguments>
			</arguments>
		</buildCommand>
		<buildCommand>
			<name>com.genuitec.eclipse.j2eedt.core.J2EEProjectValidator</name>
			<arguments>
			</arguments>
		</buildCommand>
		<buildCommand>
			<name>com.genuitec.eclipse.j2eedt.core.DeploymentDescriptorValidator</name>
			<arguments>
			</arguments>
		</buildCommand>
		<buildCommand>
			<name>org.eclipse.wst.validation.validationbuilder</name>
			<arguments>
			</arguments>
		</buildCommand>
		<buildCommand>
			<name>com.genuitec.eclipse.ast.deploy.core.DeploymentBuilder</name>
			<arguments>
			</arguments>
		</buildCommand>
	</buildSpec>
	<natures>
		<nature>com.genuitec.eclipse.ast.deploy.core.deploymentnature</nature>
		<nature>com.genuitec.eclipse.j2eedt.core.webnature</nature>
		<nature>org.eclipse.jdt.core.javanature</nature>
	</natures>

这样就可解决这个问题了
部署错误情况二
接上面的情况继续部署工程,发现不能把工程发布到服务器中,报错如下:
Undefined exploded archive location
仔细对应二个工程属性文件上,从SVN上checkout出来的项目中没有.mymetadata文件,
可能webrootdir被改无效了或者少了这context-root这个属性,如上操作,将.mymetadata文件拷贝到工程中,修改相应的工程名称,请注意一点的是.WebRoot的名字是否正确
,内容如下:
<?xml version="1.0" encoding="UTF-8"?>
<project-module
  type="WEB"
  name="XXXX"
  id="myeclipse.1202968712015"
  context-root="/XXXX"
  j2ee-spec="1.3"
  archive="XXXX.war">
  <attributes>
    <attribute name="webrootdir" value="WebRoot" />
  </attributes>
</project-module>

注意事项:在myeclipse中创建的可能不是WebRoot这个名字,可能是:WebContent
那么请修改.mymetadata文件中webrootdir对应的value
.如下:
<attribute name="webrootdir" value="WebContent" />

最后关掉Eclipse,再启动Eclipse,接着发布工程,发布成功!
  • 大小: 21.4 KB
  • 大小: 17.1 KB
  • 大小: 24.5 KB
  • 大小: 51.7 KB
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics