Return-Path: Mailing-List: contact tomcat-dev-help@jakarta.apache.org; run by ezmlm Delivered-To: mailing list tomcat-dev@jakarta.apache.org Received: (qmail 49128 invoked from network); 1 Mar 2001 21:15:22 -0000 Received: from vortex.more.net (198.209.253.169) by h31.sny.collab.net with SMTP; 1 Mar 2001 21:15:22 -0000 Received: from voyager.apg.more.net (b5fan.spg.more.net [207.160.133.142]) by vortex.more.net (8.11.0/8.11.0) with ESMTP id f21LFLq05935 for ; Thu, 1 Mar 2001 15:15:21 -0600 (CST) Sender: glenn@more.net Message-ID: <3A9EBBE9.476C160C@voyager.apg.more.net> Date: Thu, 01 Mar 2001 15:15:21 -0600 From: Glenn Nielsen Organization: MOREnet X-Mailer: Mozilla 4.7 [en] (X11; I; SunOS 5.7 i86pc) X-Accept-Language: en MIME-Version: 1.0 To: tomcat-dev@jakarta.apache.org Subject: Re: Tomcat 4 unpacking of WAR files behavior References: <3A9E6047.EF163B03@voyager.apg.more.net> <00b601c0a289$66070810$82deb018@intalio.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Spam-Rating: h31.sny.collab.net 1.6.2 0/1000/N 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 | */ | ----------------------------------------------------------------------