java常见问题
2015-01-08 15:07 omgee 阅读(211) 评论(0) 编辑 收藏 举报myeclipse优化方案
http://niuyuanman.blog.163.com/blog/static/8896832201228105144268/
部署时无法部署,缺少.classpath,.project文件,.mymetadata或classpath,导入文件包错误
原因: 在工程转移过程中,导致工程的配置文件出错;
解决方法: 1.在工程目录下的.mymetadata文件中可能webrootdir被改无效了(把下面内容拷到你的.mymetadate文件中的相应位置上);或者有可能少了这context-root这个属性;添加上这个属性即可,内容如下: context-root="/上面的name属性值" 2.关掉Eclipse,再启动Eclipse,接着发布工程,发布成功!
以下是一个一个.mymetadata文件的一个实例
- <?xml version="1.0" encoding="UTF-8"?>
- <project-module
- type="WEB"
- name="newspweb"
- id="myeclipse.1202968712015"
- context-root="/newspweb" j2ee-spec="1.4"
- archive="newspweb.war">
- <attributes>
- <attribute name="webrootdir" value="WebContent" />
- </attributes>
- </project-module>
还有一种
myeclipse部署时出现could not be redeployed because it could not be completely removed in the undeployment phase错误。当时挺纳闷的,重启MyEclipse,重启tomcat都没有用。后来才发现在项目的build path中发现有一些jar包有问题,引进了不存在的jar包。将提示有问题的jar包remove掉之后项目恢复正常!移调包后去classpath中相应的文件注册