tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 29526] - Cannot undeploy and deploy war file with on the same context
Date Sat, 24 Jul 2004 19:57:10 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=29526>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=29526

Cannot undeploy and deploy war file with on the same context





------- Additional Comments From cr@apama.com  2004-07-24 19:57 -------
Not using Windows isn't always an option...

The changes for 28272 uses the jar URL to see if the context.xml file exists 
inside the .war.  The jar URL connection class caches by default, and leaves a 
file descriptor open to the jar file.  By disabling caching, it doesn't and the 
jar file can be deleted.

--- ManagerServlet.java.orig	Thu Jun 17 21:02:56 2004
+++ ManagerServlet.java	Sat Jul 24 20:40:52 2004
@@ -27,6 +27,7 @@
 import java.io.IOException;
 import java.io.PrintWriter;
 import java.net.URL;
+import java.net.URLConnection;
 import java.net.MalformedURLException;
 import java.util.Iterator;
 import java.util.jar.JarEntry;
@@ -845,7 +846,9 @@
                         }
                         contextXml = new URL(contextWar +
                                              "META-INF/context.xml");
-                        stream = contextXml.openStream();
+                        URLConnection 
jarUrlConnection=contextXml.openConnection();
+                        jarUrlConnection.setUseCaches(false);
+                        stream = jarUrlConnection.getInputStream();;
                         // WAR contains META-INF/context.xml resource - install
                         deployer.install(new URL(contextWar));
                         return;

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org


Mime
View raw message