activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rajdav...@apache.org
Subject svn commit: r357174 - /incubator/activemq/trunk/activemq-core/src/main/java/org/activemq/broker/jmx/ManagementContext.java
Date Fri, 16 Dec 2005 15:54:58 GMT
Author: rajdavies
Date: Fri Dec 16 07:54:54 2005
New Revision: 357174

URL: http://svn.apache.org/viewcvs?rev=357174&view=rev
Log:
son't use createMBean() on jmx server as class might not be in the same class loader

Modified:
    incubator/activemq/trunk/activemq-core/src/main/java/org/activemq/broker/jmx/ManagementContext.java

Modified: incubator/activemq/trunk/activemq-core/src/main/java/org/activemq/broker/jmx/ManagementContext.java
URL: http://svn.apache.org/viewcvs/incubator/activemq/trunk/activemq-core/src/main/java/org/activemq/broker/jmx/ManagementContext.java?rev=357174&r1=357173&r2=357174&view=diff
==============================================================================
--- incubator/activemq/trunk/activemq-core/src/main/java/org/activemq/broker/jmx/ManagementContext.java
(original)
+++ incubator/activemq/trunk/activemq-core/src/main/java/org/activemq/broker/jmx/ManagementContext.java
Fri Dec 16 07:54:54 2005
@@ -309,7 +309,13 @@
             LocateRegistry.createRegistry(connectorPort);
             
             namingServiceObjectName = ObjectName.getInstance("naming:type=rmiregistry");
-            mbeanServer.createMBean("mx4j.tools.naming.NamingService", namingServiceObjectName,
null);
+            
+//          Do not use the createMBean as the mx4j jar may not be in the 
+            // same class loader than the server
+            Class cl = Class.forName("mx4j.tools.naming.NamingService");
+            mbeanServer.registerMBean(cl.newInstance(), namingServiceObjectName);
+            //mbeanServer.createMBean("mx4j.tools.naming.NamingService", namingServiceObjectName,
null);
+            
             // set the naming port
             Attribute attr = new Attribute("Port", new Integer(connectorPort));
             mbeanServer.setAttribute(namingServiceObjectName, attr);



Mime
View raw message