Tomcat 取消部署不会删除 Web 应用程序工件 [英] Tomcat undeploy does not remove web application artifacts

查看:39
本文介绍了Tomcat 取消部署不会删除 Web 应用程序工件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在使用管理器取消部署应用程序时,如何让 Tomcat 删除 Web 应用程序工件?

How do I get Tomcat to remove the web application artifacts when using the Manager to undeploy the application?

我使用的是 Tomcat 6.0.18.该应用程序是使用 tomcat-maven-plugin 1.0-SNAPSHOT 部署的,但行为与通过 maven 插件或 Web 界面相同.

I am using Tomcat 6.0.18. The application was deployed using the tomcat-maven-plugin 1.0-SNAPSHOT but the behavior is the same through the maven plugin or the web interface.

Tomcat 文档提供了有关取消部署在管理方法.

The Tomcat documentation provides warnings on how undeploy should behave on the Manager How To.

war文件可以删除;但是,解压后的应用程序目录仍然阻止重新部署.

The war file can be removed; however, the unpacked application directory remains preventing a redeploy.

推荐答案

您的应用程序可能无法完全取消部署,因为有后台线程(很可能是您自己启动的)或长时间运行的请求阻止了应用程序完全停止.

It might be that your application cannot completely be undeployed because there are background threads (that you most likely started yourself) or long running requests that are preventing the application to stop completely.

您是否检查了日志文件?他们是否说明了应用程序是否可以成功取消部署?还是相反?在您尝试取消部署(在 Unix 上 kill -3 processid,在 Windows 控制台中按 Ctrl-Break)并查看是否仍有不应该运行的东西后,您能否获得线程转储?

Did you inspect the log files? Did they state if the application could be undeployed successfully? Or the opposite? Can you get a Thread dump after you attempted to undeploy (kill -3 processid on Unix, Ctrl-Break in a console in Windows) and see if there is something still running that shouldn't?

另请注意,就它们占用的内存而言,我见过的大多数应用程序都无法完全取消部署.我经常遇到 OutOfMemoryErrors (PermGen),特别是在重新部署 webapps 之后(如果你用谷歌搜索,你会在 PermGen 上找到很多参考),因此我相信重新部署对于开发机器是可以的,但不适用于生产机器.最好在生产中对此感到困惑之前了解这一点.

Also note that most applications I've seen cannot be undeployed completely with regard to the memory they took. I've run into OutOfMemoryErrors (PermGen) quite often, especially after redeploying webapps (you'll find a lot of references on PermGen if you google for it) therefor I believe redeploying is ok for development machines, but not for production ones. It's better to know this before you're puzzled by this in production.

这篇关于Tomcat 取消部署不会删除 Web 应用程序工件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆