In Tomcat.initBaseDir():
authorkkolinko <kkolinko@13f79535-47bb-0310-9956-ffa450edef68>
Fri, 1 Jul 2011 20:20:33 +0000 (20:20 +0000)
committerkkolinko <kkolinko@13f79535-47bb-0310-9956-ffa450edef68>
Fri, 1 Jul 2011 20:20:33 +0000 (20:20 +0000)
set a value for catalina.home only if it has not been set previously.

Without this fix, I guess, you won't be able to run embedded Tomcat with
separate catalina.base and catalina.home.

git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@1142068 13f79535-47bb-0310-9956-ffa450edef68

java/org/apache/catalina/startup/Tomcat.java
webapps/docs/changelog.xml

index 2281ae9..bfb4cf0 100644 (file)
@@ -613,11 +613,12 @@ public class Tomcat {
     }
     
     protected void initBaseDir() {
+        String catalinaHome = System.getProperty(Globals.CATALINA_HOME_PROP);
         if (basedir == null) {
             basedir = System.getProperty(Globals.CATALINA_BASE_PROP);
         }
         if (basedir == null) {
-            basedir = System.getProperty(Globals.CATALINA_HOME_PROP);
+            basedir = catalinaHome;
         }
         if (basedir == null) {
             // Create a temp dir.
@@ -633,7 +634,9 @@ public class Tomcat {
                 }
             }
         }
-        System.setProperty(Globals.CATALINA_HOME_PROP, basedir);
+        if (catalinaHome == null) {
+            System.setProperty(Globals.CATALINA_HOME_PROP, basedir);
+        }
         System.setProperty(Globals.CATALINA_BASE_PROP, basedir);
     }
 
index 1408706..8e78c08 100644 (file)
         Prevent possible NPE when serving Servlets that implement the
         SingleThreadModel interface. (markt)
       </fix>
+      <fix>
+        In launcher for embedded Tomcat: do not change <code>catalina.home</code>
+        system property if it had a value. (kkolinko)
+      </fix>
     </changelog>
   </subsection>
   <subsection name="Coyote">
       <fix>
         <bug>36362</bug>: Handle the case where tag file attributes (which can
         use any valid XML name) have a name which is not a Java identifier.
-        (markt)
+        (markt/kkolinko)
       </fix>
       <add>
         Broaden the exception handling in the EL Parser so that more failures to