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

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

博客分类:  myeclipse
myeclipse webroot .project .mymetadata 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 
报错图片如下: 
myeclipse之不能部署问题(Undefined exploded archive location)_第1张图片 
说明一下,我的工程类型为J2EE1.3,编译语法为1.4,检查工程的相关文件,其中的.project文件内容如下 
Xml代码   收藏代码
  1. xml version="1.0" encoding="UTF-8"?>  
  2. <projectDescription>  
  3.     <name>XXXXname>  
  4.     <comment>comment>  
  5.     <projects>  
  6.     projects>  
  7.     <buildSpec>  
  8.         <buildCommand>  
  9.             <name>com.genuitec.eclipse.j2eedt.core.WebClasspathBuildername>  
  10.             <arguments>  
  11.             arguments>  
  12.         buildCommand>  
  13.         <buildCommand>  
  14.             <name>org.eclipse.jdt.core.javabuildername>  
  15.             <arguments>  
  16.             arguments>  
  17.         buildCommand>  
  18.         <buildCommand>  
  19.             <name>com.genuitec.eclipse.j2eedt.core.J2EEProjectValidatorname>  
  20.             <arguments>  
  21.             arguments>  
  22.         buildCommand>  
  23.         <buildCommand>  
  24.             <name>com.genuitec.eclipse.j2eedt.core.DeploymentDescriptorValidatorname>  
  25.             <arguments>  
  26.             arguments>  
  27.         buildCommand>  
  28.         <buildCommand>  
  29.             <name>org.eclipse.wst.validation.validationbuildername>  
  30.             <arguments>  
  31.             arguments>  
  32.         buildCommand>  
  33.         <buildCommand>  
  34.             <name>com.genuitec.eclipse.ast.deploy.core.DeploymentBuildername>  
  35.             <arguments>  
  36.             arguments>  
  37.         buildCommand>  
  38.     buildSpec>  
  39.     <natures>  
  40.         <nature>com.genuitec.eclipse.j2eedt.core.webnaturenature>  
  41.         <nature>org.eclipse.jdt.core.javanaturenature>  
  42.     natures>  
  43. projectDescription>  

你也许会问,如何查看这个.project文件呢,有二种方法,一种是在物理磁盘上你的工程下面 
第二种是在Eclipse中,如下图所示 
点击Package Explorer右边的下拉小三角 
myeclipse之不能部署问题(Undefined exploded archive location)_第2张图片 
点击Filters... 
myeclipse之不能部署问题(Undefined exploded archive location)_第3张图片 
把框中第一个复选框勾选取消(.resources) 
myeclipse之不能部署问题(Undefined exploded archive location)_第4张图片 
3 点击确定后就可在工程中查看到.project文件了  
你可根据工程的使用的版本,创建相应的工程,将其中的.project文件内容拷贝过去, 
如下,我创建的是J2EE1.3的版本,粘贴至相应的位置,内容如下: 
Xml代码   收藏代码
  1. <buildSpec>  
  2.         <buildCommand>  
  3.             <name>com.genuitec.eclipse.j2eedt.core.WebClasspathBuildername>  
  4.             <arguments>  
  5.             arguments>  
  6.         buildCommand>  
  7.         <buildCommand>  
  8.             <name>org.eclipse.jdt.core.javabuildername>  
  9.             <arguments>  
  10.             arguments>  
  11.         buildCommand>  
  12.         <buildCommand>  
  13.             <name>com.genuitec.eclipse.j2eedt.core.J2EEProjectValidatorname>  
  14.             <arguments>  
  15.             arguments>  
  16.         buildCommand>  
  17.         <buildCommand>  
  18.             <name>com.genuitec.eclipse.j2eedt.core.DeploymentDescriptorValidatorname>  
  19.             <arguments>  
  20.             arguments>  
  21.         buildCommand>  
  22.         <buildCommand>  
  23.             <name>org.eclipse.wst.validation.validationbuildername>  
  24.             <arguments>  
  25.             arguments>  
  26.         buildCommand>  
  27.         <buildCommand>  
  28.             <name>com.genuitec.eclipse.ast.deploy.core.DeploymentBuildername>  
  29.             <arguments>  
  30.             arguments>  
  31.         buildCommand>  
  32.     buildSpec>  
  33.     <natures>  
  34.         <nature>com.genuitec.eclipse.ast.deploy.core.deploymentnaturenature>  
  35.         <nature>com.genuitec.eclipse.j2eedt.core.webnaturenature>  
  36.         <nature>org.eclipse.jdt.core.javanaturenature>  
  37.     natures>  

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

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

最后关掉Eclipse,再启动Eclipse,接着发布工程,发布成功!
原文链接: http://liuzidong.iteye.com/blog/1233928

你可能感兴趣的:(myeclipse,部署问题)