Bug 35819 - Removal of WorkDir on undeploy
Removal of WorkDir on undeploy
Product: Tomcat 5
Classification: Unclassified
Component: Catalina
PC Windows 2000
: P2 normal (vote)
: ---
Assigned To: Tomcat Developers Mailing List
Depends on:
  Show dependency tree
Reported: 2005-07-21 18:00 UTC by Rob Steele
Modified: 2005-07-21 15:41 UTC (History)
0 users


Note You need to log in before you can comment on or make changes to this bug.
Description Rob Steele 2005-07-21 18:00:57 UTC
When an app is undeployed via the manager (that was previously deployed with the
manager), its associated work directory is not removed from Tomcat.  This is on
Windows 2000, whether Tomcat is executed as a service OR from the command line.
 This can lead to stale JSPs being executed, among other things.

Looking at the source code, it appears as though the work dir was *intended* to
be removed when the Context is destroyed.  The following patch to the 5.5.9 code
base seems to fix the problem:

2005-03-26 13:24:02.000000000 -0500
2005-07-15 15:00:36.156708000 -0400
@@ -1240,7 +1240,7 @@
         // Called from StandardContext.destroy()
         if (log.isDebugEnabled())
-        String workDir = ((StandardContext) context).getWorkDir();
+        String workDir = ((StandardContext) context).getWorkPath();
         if (workDir != null)
             ExpandWar.delete(new File(workDir));
Comment 1 Yoav Shapira 2005-07-21 23:41:19 UTC
I've implemented this for 5.5.10: thanks for the contribution.