2013-10-08 60 views
3

我无法在Windows上的Tomcat 7上重新部署我的应用程序。它尝试取消部署应用程序,但无法删除一个文件: jaxb-impl-2.1.13.jar。然后我不能再部署该应用程序,因为该文件存在。无法重新部署应用程序(使用JAXB)

如果我重新启动Tomcat,我可以部署应用程序。

这是我在日志中得到:

Oct 08, 2013 12:00:28 PM org.apache.catalina.startup.HostConfig deleteRedeployResources 
INFO: Undeploying context [/myApp] 
Oct 08, 2013 12:00:28 PM org.apache.catalina.startup.ExpandWar deleteDir 
SEVERE: [C:\Program Files (x86)\Apache Software Foundation\Tomcat 7.0\webapps\myApp\WEB-INF\lib] could not be completely deleted. The presence of the remaining files may cause problems 
Oct 08, 2013 12:00:28 PM org.apache.catalina.startup.ExpandWar deleteDir 
SEVERE: [C:\Program Files (x86)\Apache Software Foundation\Tomcat 7.0\webapps\myApp\WEB-INF] could not be completely deleted. The presence of the remaining files may cause problems 
Oct 08, 2013 12:00:28 PM org.apache.catalina.startup.ExpandWar deleteDir 
SEVERE: [C:\Program Files (x86)\Apache Software Foundation\Tomcat 7.0\webapps\myApp] could not be completely deleted. The presence of the remaining files may cause problems 
Oct 08, 2013 12:00:28 PM org.apache.catalina.startup.ExpandWar delete 
SEVERE: [C:\Program Files (x86)\Apache Software Foundation\Tomcat 7.0\webapps\myApp] could not be completely deleted. The presence of the remaining files may cause problems 

我没有在Linux上得到这个问题,只能在Windows上。我如何发布这个文件,以便我可以重新部署我的应用程序?

+0

您好,我有同样的问题也可以在Linux,并在Tomcat 6.0.32上。我发现启动“find leaks”函数,然后重新取消部署webapp可以部分解决问题(jar可以被删除,但类仍保留在内存中)。 – Alberto

+0

同样的问题在这里以及... Windows 7 64位和tomcat 6.0.35。即使使用find leaks函数并尝试另一个取消部署,jar仍然保留在原来的位置。 – sataniccrow

回答

4

我刚刚清楚这个问题。关于锁定问题的原因,你可以检查apache wiki

一个解决这个问题的办法是配置Context标签的下列属性在context.xml

  • antiJARLocking="true"
  • antiResourceLocking="true"
相关问题