问题描述
通常,当我在Tomcat的webapps文件夹中添加一个更新的war文件时,相应的webapp会自动更新。但是有时候,当我更新一个war文件时,发生一个奇怪的事情:除了一些随机的文件集合外,大部分webapp的文件夹被删除。在这种情况下,webapp不再有效。为了使其工作,我必须停止Tomcat,完全删除该webapp的文件夹,然后重新启动Tomcat。
我尝试从Tomcat管理器中停止webapp,然后再放入在webapps中的war文件 - 这没有帮助。
我试图将autodeploy和/或unpackwars更改为false,但是webapp没有被更新所有的时候我把新的warfile。
我也试图使用Jenkins的部署插件,但同样的问题发生。
$ b $
根据Tomcat 7配置指南:
可能的问题是,自动部署者仍然没有完成删除扩展目录,而另一个线程开始重新部署它。
我的解决方法是删除旧的war文件,等到目录被删除,然后才能放入新的war文件,因为:
Usually, when I put an updated war file in Tomcat's webapps folder, the appropriate webapp is automatically updated.
But sometimes, when I put an updated war file, a strange thing happens: most of that webapp's folder is deleted, except some random collection of files. Of course in this case the webapp no longer works. To make it work, I must stop Tomcat, delete the folder of that webapp entirely, then restart Tomcat.
I tried to stop the webapp from the Tomcat manager before putting the war file in webapps - it didn't help.
I tried to change "autodeploy" and/or "unpackwars" to false, but then the webapp was not updated at all when I put the new warfile.
I also tried to use Jenkins' deployment plugin, but the same problem happened.
System spec: Tomcat 7 on Windows 2003.
According to Tomcat 7 configuration guide: http://tomcat.apache.org/tomcat-7.0-doc/config/host.html#Automatic%20Application%20Deployment
Probably, the problem is that the auto-deployer still hasn't finished to remove the expanded directory, while another thread started re-deploying it.
My workaround is to delete the old war-file, wait until the directory is removed, and only then put the new war-file, since:
这篇关于当插入新的war文件时,Tomcat webapp文件夹被破坏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!