项目部署问题-could not be redeployed

来源:互联网 发布:360通用php防护代码 编辑:程序博客网 时间:2024/05/21 10:31

当你把一个项目copy然后部署在另外的IDE时,可能会遇到这种情况,大概有三类错误

1.改完项目的名字不能正常部署,

  解决方法:Properties->MyEclipse->Web->Context Root

  其中的Web Context-root的值改为你现在新项目的名字。

2.XXX could not be redeployed because it could not be completely removed in the undeployment phase. the most common cuase of this problem is attempting to redeploy while the server is running,which has locked one or more files. 

.classpath中的引用类在新环境中找不到,jar的问题。

解决办法:
把项目中引用的jar文件重新加一遍就行了,基本原因就是以前的jar文件不存在了,但是项目信息中还有,即项目的.classpath文件中还有不存在的jar文件引用。
可以右键点项目名称,选择Properties,选择Java Build Path,选择Libraries,把所有项目中的jar都remove,然后再点"add jars",把项目中的jar文件都加进来,再次部署就正常了。
大不了删除项目,重新创建项目,再把想要jar包加进来,然后重新部署项目,启动,绝对能搞定!(参考http://zhuxinzx.iteye.com/blog/697192)

3.项目名称 could not be redeployed because it could not be completely removed in the undeployment phase. The most common cause of this problem is attempting to redeploy while the server is running, which has locked one or more files.
 To correct the deployment you will need to stop the server and then redeploy the project before restarting the sever

由于更新了某些信息,不能及时加载到服务器,因为没有及时部署服务器。

解决办法:

  • 选中工程
  • 右键点击工程名
  • 选择MyEclipse---add or remove Project Deployments
  • 选中服务器(表中的部署路径)
  • remove服务器
  • 重新add服务器
  • 点击reDeploy即可完成重新部署(参考http://hanxin0311.iteye.com/blog/417414)