tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Glenn Nielsen <gl...@voyager.apg.more.net>
Subject Re: Tomcat 4 unpacking of WAR files behavior
Date Thu, 01 Mar 2001 21:15:21 GMT
Remy Maucherat wrote:
> 
> > 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
> 
>


I consider this a bug.  Tomcat should not be removing contexts that have
been expanded out into a directory in webapps.


If unpackWARs="false", then nothing is expanded out into webapss, the war
file is expanded out as needed into the work dir, correct?


But if unpackWARs="true", what should the behaviour be in the following cases:

A war file exits, but no directory exists matching war file prefix.
-> create directory name matching war file prefix and expand war file.

A war file exists, and a corresponding directory exists.  The war file last
mod time is older than directory. -> Don't expand war file.

A war file exists, and a corresponding directory exists. The war file last
mod time is newer than the directory. ->  ???  You have one of two cases,
a completely different web app exists in a directory with the same name as
a new war file, or an updated war file for was installed and the directory
is for the previously expanded version.  What now?

And when tomcat is shutdown it should not remove any unpacked war files,
this can significantly increase the time it takes tomcat to startup/shutdown.

Regards,

Glenn


----------------------------------------------------------------------
Glenn Nielsen             glenn@more.net | /* Spelin donut madder    |
MOREnet System Programming               |  * if iz ina coment.      |
Missouri Research and Education Network  |  */                       |
----------------------------------------------------------------------

Mime
View raw message