【问题标题】:Can't redeploy application (using JAXB)无法重新部署应用程序(使用 JAXB)
【发布时间】:2013-10-15 07:01:27
【问题描述】:

我无法在 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

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

【问题讨论】:

  • 嗨,我在 Linux 和 Tomcat 6.0.32 上也有同样的问题。我看到启动“查找泄漏”功能,然后重新取消部署 webapp 可以部分解决问题(可以删除 jar,但类仍然加载在内存中)。
  • 这里也有同样的问题... Windows 7 64 位和 tomcat 6.0.35。即使使用 find leaks 功能并尝试再次取消部署,jar 仍然保持原位。

标签: tomcat jaxb


【解决方案1】:

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

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

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

【讨论】:

  • 来自Tomcat docs 的仅供参考:“antiJARLocking 是 antiResourceLocking 的子集,因此,为防止重复工作和可能出现的问题,任何时候都应将这些属性中的一个设置为 true”
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2021-01-18
  • 2016-09-14
  • 1970-01-01
  • 1970-01-01
  • 2012-05-09
相关资源
最近更新 更多