From ddab6d3313cfa4a2487f096908540ae79ef42cfa Mon Sep 17 00:00:00 2001 From: fhanik Date: Tue, 17 Oct 2006 14:05:50 +0000 Subject: [PATCH] Fixed startup exception git-svn-id: https://svn.apache.org/repos/asf/tomcat/tc6.0.x/trunk@464928 13f79535-47bb-0310-9956-ffa450edef68 --- java/org/apache/catalina/ha/deploy/FarmWarDeployer.java | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/java/org/apache/catalina/ha/deploy/FarmWarDeployer.java b/java/org/apache/catalina/ha/deploy/FarmWarDeployer.java index 78d88cb07..fffbdc43c 100644 --- a/java/org/apache/catalina/ha/deploy/FarmWarDeployer.java +++ b/java/org/apache/catalina/ha/deploy/FarmWarDeployer.java @@ -142,12 +142,18 @@ public class FarmWarDeployer extends ClusterListener implements ClusterDeployer, watcher = new WarWatcher(this, new File(getWatchDir())); if (log.isInfoEnabled()) log.info("Cluster deployment is watching " + getWatchDir() - + " for changes."); + + " for changes."); } - + // Check to correct engine and host setup - host = (Host) getCluster().getContainer(); - Engine engine = (Engine) host.getParent(); + Object parent = getCluster().getContainer(); + Engine engine = null; + if ( parent instanceof Host ) { + host = (Host) parent; + engine = (Engine) host.getParent(); + }else { + engine = (Engine)parent; + } try { oname = new ObjectName(engine.getName() + ":type=Deployer,host=" + host.getName()); @@ -157,8 +163,7 @@ public class FarmWarDeployer extends ClusterListener implements ClusterDeployer, configBase = new File(System.getProperty("catalina.base"), "conf"); if (engine != null) { configBase = new File(configBase, engine.getName()); - } - if (host != null) { + } else if (host != null) { configBase = new File(configBase, host.getName()); } -- 2.11.0