You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2004/12/30 19:06:53 UTC
cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/core StandardHostDeployer.java
markt 2004/12/30 10:06:53
Modified: catalina/src/share/org/apache/catalina/core
StandardHostDeployer.java
Log:
Fix bug 32779. NPE on undeploy when deployed with a context.xml file
Revision Changes Path
1.16 +11 -2 jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/core/StandardHostDeployer.java
Index: StandardHostDeployer.java
===================================================================
RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/core/StandardHostDeployer.java,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- StandardHostDeployer.java 26 Aug 2004 21:32:20 -0000 1.15
+++ StandardHostDeployer.java 30 Dec 2004 18:06:53 -0000 1.16
@@ -478,16 +478,25 @@
// Determine if directory/war to remove is in the host appBase
boolean isAppBase = false;
+
File appBase = new File(host.getAppBase());
if (!appBase.isAbsolute())
appBase = new File(System.getProperty("catalina.base"),
host.getAppBase());
+
File contextFile = new File(context.getDocBase());
+
+ if (!contextFile.isAbsolute()) {
+ // Must be relative to appBase
+ contextFile = new File(appBase.getAbsolutePath(),
+ contextFile.getPath());
+ }
+
File baseDir = contextFile.getParentFile();
if (appBase.getCanonicalPath().equals(baseDir.getCanonicalPath())) {
isAppBase = true;
}
-
+
boolean isWAR = false;
if (contextFile.getName().toLowerCase().endsWith(".war")) {
isWAR = true;
---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org