> What is the expected behaviour of Tomcat 4 when starting/stopping
> in regards to unpacking war files.
>
> I noticed what to me seems like strange behaviour.
>
> The Host is configured in server.xml with unpackWARs="true".
>
> ls of webapps before starting tomcat, notice that some of the war
> files are not expanded out.
>
> $ ls -l webapps
> total 1091
> drwxr-xr-x   9 tomcatd  tomcatd       512 Feb 18 09:06 ROOT
> drwxr-xr-x   8 tomcatd  tomcatd       512 Feb 18 09:06 examples
> drwxr-xr-x   5 tomcatd  tomcatd       512 Feb 17 06:42 jdbc-doc
> -rw-r--r--   1 tomcatd  tomcatd    168332 Feb 15 16:19 jdbc-doc.war
> drwxr-xr-x   4 tomcatd  tomcatd       512 Feb 25 20:27 jdbc-examples
> -rw-r--r--   1 tomcatd  tomcatd     39156 Feb 15 16:19 jdbc-examples.war
> drwxr-xr-x   5 tomcatd  tomcatd       512 Feb 16 13:20 jndi-doc
> -rw-r--r--   1 tomcatd  tomcatd     79042 Feb 15 16:37 jndi-doc.war
> drwxr-xr-x   4 tomcatd  tomcatd       512 Feb 17 06:42 jndi-examples
> -rw-r--r--   1 tomcatd  tomcatd     33516 Feb 15 16:37 jndi-examples.war
> -rw-r--r--   1 tomcatd  tomcatd    411591 Mar  1 06:09 jsp-tests.war
> drwxr-xr-x   5 tomcatd  tomcatd       512 Feb 18 09:06 manager
> drwxr-xr-x   5 tomcatd  tomcatd       512 Feb 17 06:42 request-doc
> -rw-r--r--   1 tomcatd  tomcatd    159409 Feb 16 13:25 request-doc.war
> drwxr-xr-x   4 tomcatd  tomcatd       512 Feb 17 06:42 request-examples
> -rw-r--r--   1 tomcatd  tomcatd     36690 Feb 16 13:25
request-examples.war
> -rw-r--r--   1 tomcatd  tomcatd     51150 Feb 26 20:36 scrape-doc.war
> -rw-r--r--   1 tomcatd  tomcatd     86902 Feb 26 20:36 scrape-examples.war
> drwxr-xr-x   5 tomcatd  tomcatd       512 Feb 18 09:06 webdav
>
> ls of webapps after starting tomcat, all war files are expanded.
>
> $ ls -l webapps
> total 1094
> drwxr-xr-x   9 tomcatd  tomcatd       512 Feb 18 09:06 ROOT
> drwxr-xr-x   8 tomcatd  tomcatd       512 Feb 18 09:06 examples
> drwxr-xr-x   5 tomcatd  tomcatd       512 Feb 17 06:42 jdbc-doc
> -rw-r--r--   1 tomcatd  tomcatd    168332 Feb 15 16:19 jdbc-doc.war
> drwxr-xr-x   4 tomcatd  tomcatd       512 Feb 25 20:27 jdbc-examples
> -rw-r--r--   1 tomcatd  tomcatd     39156 Feb 15 16:19 jdbc-examples.war
> drwxr-xr-x   5 tomcatd  tomcatd       512 Feb 16 13:20 jndi-doc
> -rw-r--r--   1 tomcatd  tomcatd     79042 Feb 15 16:37 jndi-doc.war
> drwxr-xr-x   4 tomcatd  tomcatd       512 Feb 17 06:42 jndi-examples
> -rw-r--r--   1 tomcatd  tomcatd     33516 Feb 15 16:37 jndi-examples.war
> drwxr-xr-x   5 tomcatd  tomcatd       512 Mar  1 08:27 jsp-tests
> -rw-r--r--   1 tomcatd  tomcatd    411591 Mar  1 06:09 jsp-tests.war
> drwxr-xr-x   5 tomcatd  tomcatd       512 Feb 18 09:06 manager
> drwxr-xr-x   5 tomcatd  tomcatd       512 Feb 17 06:42 request-doc
> -rw-r--r--   1 tomcatd  tomcatd    159409 Feb 16 13:25 request-doc.war
> drwxr-xr-x   4 tomcatd  tomcatd       512 Feb 17 06:42 request-examples
> -rw-r--r--   1 tomcatd  tomcatd     36690 Feb 16 13:25
request-examples.war
> drwxr-xr-x   5 tomcatd  tomcatd       512 Mar  1 08:28 scrape-doc
> -rw-r--r--   1 tomcatd  tomcatd     51150 Feb 26 20:36 scrape-doc.war
> drwxr-xr-x   4 tomcatd  tomcatd       512 Mar  1 08:28 scrape-examples
> -rw-r--r--   1 tomcatd  tomcatd     86902 Feb 26 20:36 scrape-examples.war
> drwxr-xr-x   5 tomcatd  tomcatd       512 Feb 18 09:06 webdav
>
> ls of webapps after stopping tomcat, notice that the war files that
> tomcat had expanded out now have their directories removed.
>
>  $ ls -l webapps
> total 1091
> drwxr-xr-x   9 tomcatd  tomcatd       512 Feb 18 09:06 ROOT
> drwxr-xr-x   8 tomcatd  tomcatd       512 Feb 18 09:06 examples
> drwxr-xr-x   5 tomcatd  tomcatd       512 Feb 17 06:42 jdbc-doc
> -rw-r--r--   1 tomcatd  tomcatd    168332 Feb 15 16:19 jdbc-doc.war
> drwxr-xr-x   4 tomcatd  tomcatd       512 Feb 25 20:27 jdbc-examples
> -rw-r--r--   1 tomcatd  tomcatd     39156 Feb 15 16:19 jdbc-examples.war
> drwxr-xr-x   5 tomcatd  tomcatd       512 Feb 16 13:20 jndi-doc
> -rw-r--r--   1 tomcatd  tomcatd     79042 Feb 15 16:37 jndi-doc.war
> drwxr-xr-x   4 tomcatd  tomcatd       512 Feb 17 06:42 jndi-examples
> -rw-r--r--   1 tomcatd  tomcatd     33516 Feb 15 16:37 jndi-examples.war
> -rw-r--r--   1 tomcatd  tomcatd    411591 Mar  1 06:09 jsp-tests.war
> drwxr-xr-x   5 tomcatd  tomcatd       512 Feb 18 09:06 manager
> drwxr-xr-x   5 tomcatd  tomcatd       512 Feb 17 06:42 request-doc
> -rw-r--r--   1 tomcatd  tomcatd    159409 Feb 16 13:25 request-doc.war
> drwxr-xr-x   4 tomcatd  tomcatd       512 Feb 17 06:42 request-examples
> -rw-r--r--   1 tomcatd  tomcatd     36690 Feb 16 13:25
request-examples.war
> -rw-r--r--   1 tomcatd  tomcatd     51150 Feb 26 20:36 scrape-doc.war
> -rw-r--r--   1 tomcatd  tomcatd     86902 Feb 26 20:36 scrape-examples.war
> drwxr-xr-x   5 tomcatd  tomcatd       512 Feb 18 09:06 webdav
>
> What is the point in having Tomcat 4 unpack the war files if it removes
> the unpacked war file directory when Tomcat stops?

I think it was to make it equivalent to running the web application directly
from the WAR.
Now that we actually *can* run webapps from a WAR (as long as they don't
involve JSPs, because Jasper relies too much on getPathTranslated and
getRealPath), it could be useful to not remove the expanded WARs anymore.
After that is fixed, I suggest setting unpackWARs to false as the default.

> Why are some unpacked war file directories removed, and others are left
alone?
>
> What if you modified the web application you installed, or it manages some
> properties files in its own WEB-INF/classes directory?
>
> Is this the expected behaviour?

Up until now, yes (it's definitely not a bug).
We could consider changing this behavior (after beta 2).

Remy


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]

Reply via email to