From 76d9fccb2d6c2972217547a9e929af5e7fd31b0b Mon Sep 17 00:00:00 2001 From: Bosanac Dejan Date: Thu, 19 Feb 2009 12:09:21 +0000 Subject: [PATCH] additional fix for https://issues.apache.org/activemq/browse/AMQ-2085 git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@745833 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/activemq/broker/jmx/ManagementContext.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/activemq-core/src/main/java/org/apache/activemq/broker/jmx/ManagementContext.java b/activemq-core/src/main/java/org/apache/activemq/broker/jmx/ManagementContext.java index 5bcacd17a5..a3f3ae3053 100644 --- a/activemq-core/src/main/java/org/apache/activemq/broker/jmx/ManagementContext.java +++ b/activemq-core/src/main/java/org/apache/activemq/broker/jmx/ManagementContext.java @@ -55,7 +55,7 @@ public class ManagementContext implements Service { private boolean createMBeanServer = true; private boolean locallyCreateMBeanServer; private boolean createConnector = true; - private boolean findTigerMbeanServer; + private boolean findTigerMbeanServer = true; private int connectorPort = 1099; private int rmiServerPort; private String connectorPath = "/jmxrmi"; @@ -297,7 +297,7 @@ public class ManagementContext implements Service { return result; } - public static MBeanServer findTigerMBeanServer() { + public MBeanServer findTigerMBeanServer() { String name = "java.lang.management.ManagementFactory"; Class type = loadClass(name, ManagementContext.class.getClassLoader()); if (type != null) { @@ -306,6 +306,9 @@ public class ManagementContext implements Service { if (method != null) { Object answer = method.invoke(null, new Object[0]); if (answer instanceof MBeanServer) { + if (createConnector) { + createConnector((MBeanServer)answer); + } return (MBeanServer)answer; } else { LOG.warn("Could not cast: " + answer + " into an MBeanServer. There must be some classloader strangeness in town");