From 1a3b0545dc2ed288789edf5e21c14f6441ae572a Mon Sep 17 00:00:00 2001 From: kkolinko Date: Fri, 1 Jul 2011 20:20:33 +0000 Subject: [PATCH] In Tomcat.initBaseDir(): 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 | 7 +++++-- webapps/docs/changelog.xml | 6 +++++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/java/org/apache/catalina/startup/Tomcat.java b/java/org/apache/catalina/startup/Tomcat.java index 2281ae98f..bfb4cf0c1 100644 --- a/java/org/apache/catalina/startup/Tomcat.java +++ b/java/org/apache/catalina/startup/Tomcat.java @@ -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); } diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml index 140870632..8e78c0850 100644 --- a/webapps/docs/changelog.xml +++ b/webapps/docs/changelog.xml @@ -190,6 +190,10 @@ Prevent possible NPE when serving Servlets that implement the SingleThreadModel interface. (markt) + + In launcher for embedded Tomcat: do not change catalina.home + system property if it had a value. (kkolinko) + @@ -235,7 +239,7 @@ 36362: 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) Broaden the exception handling in the EL Parser so that more failures to -- 2.11.0