开发者

tomcat deletes exploded webapps

开发者 https://www.devze.com 2022-12-11 20:08 出处:网络
Each time I shut down Tomcat 开发者_如何学运维server, it deletes my exploded webapp. What do I have to do to stop that? It\'s really inconvenient constantly copying it again under the webapps dir.This

Each time I shut down Tomcat 开发者_如何学运维server, it deletes my exploded webapp. What do I have to do to stop that? It's really inconvenient constantly copying it again under the webapps dir.


This can happen with Tomcat 5 if you have a WAR under your webapps directory. Tomcat has 3 modes of deployment,

  1. Context fragment. A XML file under conf/Catalina/[host]
  2. WAR. A file ended with war in appBase (normally webapps)
  3. Directory. A directory (normally exploded WAR) in appBase

Looks like you are mixing 2 & 3 and Tomcat is confused. If you put war under webapps, Tomcat will explode it automatically. If you want explode it yourself, don't put WAR under webapps and Tomcat should leave your directory alone.

You can also run WAR without exploding it by adding this to your Context,

unpackWAR="false"


I've never seen it do that.

One option would be to place the exploded webapp in a directory outside of the Tomcat install, then add a deployment descriptor referencing it in the conf/Catalina/localhost directory. I typically work that way, and Tomcat has never deleted any files on me!

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号