[jboss-cvs] JBossAS SVN: r65547 - trunk/tomcat/src/main/org/jboss/web/tomcat/service/session.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Fri Sep 21 23:32:59 EDT 2007


Author: bstansberry at jboss.com
Date: 2007-09-21 23:32:59 -0400 (Fri, 21 Sep 2007)
New Revision: 65547

Modified:
   trunk/tomcat/src/main/org/jboss/web/tomcat/service/session/JBossCacheCluster.java
Log:
[JBAS-4623] Don't set the 'jboss' server if it already exists

Modified: trunk/tomcat/src/main/org/jboss/web/tomcat/service/session/JBossCacheCluster.java
===================================================================
--- trunk/tomcat/src/main/org/jboss/web/tomcat/service/session/JBossCacheCluster.java	2007-09-22 02:55:38 UTC (rev 65546)
+++ trunk/tomcat/src/main/org/jboss/web/tomcat/service/session/JBossCacheCluster.java	2007-09-22 03:32:59 UTC (rev 65547)
@@ -22,10 +22,8 @@
 package org.jboss.web.tomcat.service.session;
 
 import java.io.File;
-import java.io.FileInputStream;
 import java.io.FileNotFoundException;
 import java.io.IOException;
-import java.io.InputStream;
 import java.net.URL;
 import java.util.ArrayList;
 
@@ -45,7 +43,6 @@
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.jboss.cache.config.Configuration;
-import org.jboss.cache.factories.XmlConfigurationParser;
 import org.jboss.cache.pojo.PojoCacheFactory;
 import org.jboss.cache.pojo.jmx.PojoCacheJmxWrapper;
 import org.jboss.cache.pojo.jmx.PojoCacheJmxWrapperMBean;
@@ -669,7 +666,16 @@
       {         
          // Tell the JBoss MBeanServerLocator utility 
          // that Tomcat's MBean server is 'jboss'
-         MBeanServerLocator.setJBoss(getMBeanServer());
+         // JBAS-4623 Only do this if there isn't already a 'jboss' server
+         try
+         {
+            MBeanServerLocator.locateJBoss();
+         }
+         catch (IllegalStateException ise)
+         {
+            // This is the expected condition when running in standalone Tomcat
+            MBeanServerLocator.setJBoss(getMBeanServer());
+         }
          
          // Initialize the tree cache
          PojoCacheJmxWrapperMBean cache = getTreeCache();




More information about the jboss-cvs-commits mailing list