Author: pero Date: Mon Jan 21 01:26:55 2008 New Revision: 613809 URL: http://svn.apache.org/viewvc?rev=613809&view=rev Log: Fix FarmWarDeployer can be only configured as host subelement
Modified: tomcat/tc6.0.x/trunk/STATUS.txt tomcat/tc6.0.x/trunk/java/org/apache/catalina/ha/deploy/FarmWarDeployer.java tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml Modified: tomcat/tc6.0.x/trunk/STATUS.txt URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/STATUS.txt?rev=613809&r1=613808&r2=613809&view=diff ============================================================================== --- tomcat/tc6.0.x/trunk/STATUS.txt (original) +++ tomcat/tc6.0.x/trunk/STATUS.txt Mon Jan 21 01:26:55 2008 @@ -54,15 +54,6 @@ http://svn.apache.org/viewvc?rev=613266&view=rev +1: markt -1: - -* Fix FarmWarDeployer can be only config at Host Element (small changes s. tomcat 55 STATUS.txt) - http://people.apache.org/~pero/patches/tc55/2007-11-16-1-FarmWarDeployer-tc55.patch - +1: pero, markt, rjung - -1: - markt - change "FarmWarDeployer can only work as parent from " to - "FarmWarDeployer can only work if parent of " - rjung - "is an engine!" -> " is an engine!" (space added) - "work at Host" -> "work as Host" * Update JNDI docs to use server.xml less and <Context> more http://svn.apache.org/viewvc?rev=613689&view=rev Modified: tomcat/tc6.0.x/trunk/java/org/apache/catalina/ha/deploy/FarmWarDeployer.java URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/java/org/apache/catalina/ha/deploy/FarmWarDeployer.java?rev=613809&r1=613808&r2=613809&view=diff ============================================================================== --- tomcat/tc6.0.x/trunk/java/org/apache/catalina/ha/deploy/FarmWarDeployer.java (original) +++ tomcat/tc6.0.x/trunk/java/org/apache/catalina/ha/deploy/FarmWarDeployer.java Mon Jan 21 01:26:55 2008 @@ -24,6 +24,7 @@ import javax.management.MBeanServer; import javax.management.ObjectName; +import org.apache.catalina.Container; import org.apache.catalina.Context; import org.apache.catalina.Engine; import org.apache.catalina.Host; @@ -138,37 +139,43 @@ public void start() throws Exception { if (started) return; - getCluster().addClusterListener(this); - if (watchEnabled) { - watcher = new WarWatcher(this, new File(getWatchDir())); - if (log.isInfoEnabled()) - log.info("Cluster deployment is watching " + getWatchDir() - + " for changes."); + Container hcontainer = getCluster().getContainer(); + if(!(hcontainer instanceof Host)) { + log.error("FarmWarDeployer can only work as host cluster subelement!"); + return ; } + host = (Host) hcontainer; // Check to correct engine and host setup - Object parent = getCluster().getContainer(); - Engine engine = null; - String hostname = null; - if ( parent instanceof Host ) { - host = (Host) parent; - engine = (Engine) host.getParent(); - hostname = host.getName(); - }else { - engine = (Engine)parent; - hostname = engine.getDefaultHost(); + Container econtainer = host.getParent(); + if(econtainer == null && econtainer instanceof Engine) { + log.error("FarmWarDeployer can only work if parent of " + host.getName()+ " is an engine!"); + return ; } + Engine engine = (Engine) econtainer; + String hostname = null; + hostname = host.getName(); try { oname = new ObjectName(engine.getName() + ":type=Deployer,host=" + hostname); } catch (Exception e) { log.error("Can't construct MBean object name" + e); + return; } + if (watchEnabled) { + watcher = new WarWatcher(this, new File(getWatchDir())); + if (log.isInfoEnabled()) { + log.info("Cluster deployment is watching " + getWatchDir() + + " for changes."); + } + } + configBase = new File(System.getProperty("catalina.base"), "conf"); if (engine != null) { configBase = new File(configBase, engine.getName()); - } else if (host != null) { - configBase = new File(configBase, host.getName()); + } + if (host != null) { + configBase = new File(configBase, hostname); } // Retrieve the MBean server @@ -176,6 +183,9 @@ started = true; count = 0; + + getCluster().addClusterListener(this); + if (log.isInfoEnabled()) log.info("Cluster FarmWarDeployer started."); } Modified: tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml?rev=613809&r1=613808&r2=613809&view=diff ============================================================================== --- tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml (original) +++ tomcat/tc6.0.x/trunk/webapps/docs/changelog.xml Mon Jan 21 01:26:55 2008 @@ -262,6 +262,9 @@ <subsection name="Cluster"> <changelog> <fix> + Fix FarmWarDeployer can be only configured as host subelement (pero) + </fix> + <fix> Fix wrong && at ReplicationValve (pero) </fix> <update> --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]