imeikas
imeikas

Reputation: 175

tomcat deletes exploded webapps

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.

Upvotes: 1

Views: 2422

Answers (2)

ZZ Coder
ZZ Coder

Reputation: 75496

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"

Upvotes: 3

Aron
Aron

Reputation: 1642

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!

Upvotes: 2

Related Questions