From a184816488a73bbe60e6a36ac6b68c53b07ae41b Mon Sep 17 00:00:00 2001 From: Rohit Yadav Date: Mon, 11 Feb 2013 12:14:46 +0530 Subject: [PATCH] CLOUDSTACK-1181: Find by catalina.home property first The previous commit fails if a person had defined CATALINA_HOME already. Instead of system env variable, get any passed variable 'catalina.home' and find the file in that path. Signed-off-by: Rohit Yadav (cherry picked from commit 44287d20c0c52a57db0c498f7e23793109c920f2) Signed-off-by: Rohit Yadav --- developer/pom.xml | 10 ++++++++-- utils/src/com/cloud/utils/PropertiesUtil.java | 8 ++++---- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/developer/pom.xml b/developer/pom.xml index b0ae356625c..dba7b383d69 100644 --- a/developer/pom.xml +++ b/developer/pom.xml @@ -179,8 +179,8 @@ - CATALINA_HOME - ${project.parent.basedir}/utils/ + catalina.home + ${project.parent.basedir}/utils @@ -287,6 +287,12 @@ --rootpassword=${db.root.password} + + + catalina.home + ${project.parent.basedir}/utils + + diff --git a/utils/src/com/cloud/utils/PropertiesUtil.java b/utils/src/com/cloud/utils/PropertiesUtil.java index 90f8af8b33f..e256fce9440 100755 --- a/utils/src/com/cloud/utils/PropertiesUtil.java +++ b/utils/src/com/cloud/utils/PropertiesUtil.java @@ -70,14 +70,14 @@ public class PropertiesUtil { if (file.exists()) { return file; } - - newPath = System.getenv("CATALINA_HOME"); + + newPath = System.getProperty("catalina.home"); if (newPath == null) { - newPath = System.getenv("CATALINA_BASE"); + newPath = System.getenv("CATALINA_HOME"); } if (newPath == null) { - newPath = System.getProperty("catalina.home"); + newPath = System.getenv("CATALINA_BASE"); } if (newPath == null) {