mirror of https://github.com/apache/activemq.git
son't use createMBean() on jmx server as class might not be in the same class loader
git-svn-id: https://svn.apache.org/repos/asf/incubator/activemq/trunk@357174 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
0d6f94b93d
commit
634ac91c3d
|
@ -309,7 +309,13 @@ public class ManagementContext implements Service {
|
|||
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);
|
||||
|
|
Loading…
Reference in New Issue