You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by David Weinrich <dw...@home.com> on 2001/01/20 01:13:38 UTC
The case of the disappearing webapps...
Howdy,
I have some weird behavior with tomcat-4.x ( both 4.0 and 4.1 from cvs )
if I do the following:
* place a .war file in the webapps directory ( in this case the
struts .war files ).
* startup catalina normally...everything works fine.
* shutdown catalina.
* startup catalina again normally.
the expanded directories corresponding to the .war files
now are missing all content...the only things that remain
are the *.xml and *.tld files in the WEB-INF directory.
I haven't yet submitted a bug report, as I wanted to make
sure this wasn't a known-issue and possibly locate the
source of the problem first. Has anyone else had this
problem or anything like it yet?
David Weinrich
note: the system this is running on is Win2k and jdk/jre 1.3
Re: The case of the disappearing webapps...
Posted by Aaron Mulder <am...@alumni.princeton.edu>.
Probably caused by using a URLClassLoader. On Windows, it locks
JAR files and never lets go (I've seen this). Also, there was a rumor
that it caches JAR files so if you redeploy an updated app with a new JAR
file with the same name as the old one it will still use the old one, or
something like that. I haven't tried to confirm that part of it.
The only solution I've found is to implement a new ClassLoader for
JAR files, because if you're very careful with your JarFile objects and
streams you can definitely avoid this on Windows. I haven't seen that
problem on Linux.
Aaron
On Fri, 19 Jan 2001, David Weinrich wrote:
> Ok, I think I have found the problem, and I am guessing the following is
> happening:
>
> 19-Jan-2001 15:10:44 StandardHost[localhost]: Undeploying web application at
> context path /struts-test
> 19-Jan-2001 15:10:44 StandardHost[localhost]: Removing expanded directory
> c:\java\tomcat-4.1\webapps\struts-test
>
> * the container is trying to undeploy the application
> ( hey I didn't even know this happened ;) because it was
> deployed from a .war file.
>
> 19-Jan-2001 15:10:44 HostConfig[localhost] Error undeploying web application
> at context path /struts-test
> java.io.IOException: Cannot delete file
> c:\java\tomcat-4.1\webapps\struts-test\WEB-INF\lib\struts.jar
> at org.apache.catalina.core.StandardHost.remove(StandardHost.java:794)
>
> * Win2k is not allowing the container to delete a library file
> that it thinks is currently in use ( struts.jar in this case ).
>
> 19-Jan-2001 15:11:06 StandardHost[localhost]: Deploying web application at
> context path /struts-test from URL
> file:C:\java\tomcat-4.1\webapps\struts-test
>
>
> * catalina finds the struts-test directory and doesn't re-deploy the
> application from the .war file.
>
> If I shutdown, delete the expanded directories, and restart, the .war files
> deploy normally:
>
> 19-Jan-2001 15:56:26 StandardHost[localhost]: Recording expanded app at path
> /struts-test
> 19-Jan-2001 15:56:26 StandardHost[localhost]: Deploying web application at
> context path /struts-upload from URL
> jar:file:C:\java\tomcat-4.1\webapps\struts-upload.war!/
> 19-Jan-2001 15:56:26 StandardHost[localhost]:
> expand(jar:file:C:\java\tomcat-4.1\webapps\struts-upload.war!/)
> 19-Jan-2001 15:56:26 StandardHost[localhost]: Proposed directory name:
> struts-upload
> ...
>
> I will try to dig into this more later tonight/this weekend. Any
> further hints/ideas would be appreciated :)
>
> David Weinrich
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
> For additional commands, email: tomcat-dev-help@jakarta.apache.org
>
Re: The case of the disappearing webapps...
Posted by David Weinrich <dw...@home.com>.
Ok, I think I have found the problem, and I am guessing the following is
happening:
19-Jan-2001 15:10:44 StandardHost[localhost]: Undeploying web application at
context path /struts-test
19-Jan-2001 15:10:44 StandardHost[localhost]: Removing expanded directory
c:\java\tomcat-4.1\webapps\struts-test
* the container is trying to undeploy the application
( hey I didn't even know this happened ;) because it was
deployed from a .war file.
19-Jan-2001 15:10:44 HostConfig[localhost] Error undeploying web application
at context path /struts-test
java.io.IOException: Cannot delete file
c:\java\tomcat-4.1\webapps\struts-test\WEB-INF\lib\struts.jar
at org.apache.catalina.core.StandardHost.remove(StandardHost.java:794)
* Win2k is not allowing the container to delete a library file
that it thinks is currently in use ( struts.jar in this case ).
19-Jan-2001 15:11:06 StandardHost[localhost]: Deploying web application at
context path /struts-test from URL
file:C:\java\tomcat-4.1\webapps\struts-test
* catalina finds the struts-test directory and doesn't re-deploy the
application from the .war file.
If I shutdown, delete the expanded directories, and restart, the .war files
deploy normally:
19-Jan-2001 15:56:26 StandardHost[localhost]: Recording expanded app at path
/struts-test
19-Jan-2001 15:56:26 StandardHost[localhost]: Deploying web application at
context path /struts-upload from URL
jar:file:C:\java\tomcat-4.1\webapps\struts-upload.war!/
19-Jan-2001 15:56:26 StandardHost[localhost]:
expand(jar:file:C:\java\tomcat-4.1\webapps\struts-upload.war!/)
19-Jan-2001 15:56:26 StandardHost[localhost]: Proposed directory name:
struts-upload
...
I will try to dig into this more later tonight/this weekend. Any
further hints/ideas would be appreciated :)
David Weinrich