mirror of
https://github.com/apache/activemq.git
synced 2025-02-16 23:16:52 +00:00
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);
|
LocateRegistry.createRegistry(connectorPort);
|
||||||
|
|
||||||
namingServiceObjectName = ObjectName.getInstance("naming:type=rmiregistry");
|
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
|
// set the naming port
|
||||||
Attribute attr = new Attribute("Port", new Integer(connectorPort));
|
Attribute attr = new Attribute("Port", new Integer(connectorPort));
|
||||||
mbeanServer.setAttribute(namingServiceObjectName, attr);
|
mbeanServer.setAttribute(namingServiceObjectName, attr);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user