无法重新部署应用程序(使用 JAXB)

Col*_*ard 5 tomcat jaxb

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

如果我重新启动 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
Run Code Online (Sandbox Code Playgroud)

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

Tat*_*era 5

我只是清楚这个问题。由于锁定问题的原因,您可以查看apache wiki

解决此问题的方法之一是在 中配置Contexttag的以下属性context.xml

  • antiJARLocking="true"
  • antiResourceLocking="true"