Author: pero Date: Mon Jan 21 00:14:51 2008 New Revision: 613788 URL: http://svn.apache.org/viewvc?rev=613788&view=rev Log: Fix FarmWarDeployer can be only configured at host subelement
Modified: tomcat/container/tc5.5.x/modules/cluster/src/share/org/apache/catalina/cluster/deploy/FarmWarDeployer.java tomcat/container/tc5.5.x/webapps/docs/changelog.xml Modified: tomcat/container/tc5.5.x/modules/cluster/src/share/org/apache/catalina/cluster/deploy/FarmWarDeployer.java URL: http://svn.apache.org/viewvc/tomcat/container/tc5.5.x/modules/cluster/src/share/org/apache/catalina/cluster/deploy/FarmWarDeployer.java?rev=613788&r1=613787&r2=613788&view=diff ============================================================================== --- tomcat/container/tc5.5.x/modules/cluster/src/share/org/apache/catalina/cluster/deploy/FarmWarDeployer.java (original) +++ tomcat/container/tc5.5.x/modules/cluster/src/share/org/apache/catalina/cluster/deploy/FarmWarDeployer.java Mon Jan 21 00:14:51 2008 @@ -25,6 +25,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; @@ -137,23 +138,36 @@ 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 ; } - // Check to correct engine and host setup - host = (Host) getCluster().getContainer(); - Engine engine = (Engine) host.getParent(); + host = (Host) hcontainer; + 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; try { oname = new ObjectName(engine.getName() + ":type=Deployer,host=" + host.getName()); } 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."); + } + + getCluster().addClusterListener(this); + configBase = new File(System.getProperty("catalina.base"), "conf"); if (engine != null) { configBase = new File(configBase, engine.getName()); Modified: tomcat/container/tc5.5.x/webapps/docs/changelog.xml URL: http://svn.apache.org/viewvc/tomcat/container/tc5.5.x/webapps/docs/changelog.xml?rev=613788&r1=613787&r2=613788&view=diff ============================================================================== --- tomcat/container/tc5.5.x/webapps/docs/changelog.xml (original) +++ tomcat/container/tc5.5.x/webapps/docs/changelog.xml Mon Jan 21 00:14:51 2008 @@ -197,6 +197,9 @@ <subsection name="Cluster"> <changelog> <fix> + Fix FarmWarDeployer can be only configured at host subelement (pero) + </fix> + <fix> Fix wrong && at ReplicationValve (pero) </fix> <fix> --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]