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 64498270cd..502622d411 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 @@ -174,7 +174,7 @@ public class ManagementContext implements Service { } // stop naming service mbean try { - if (getMBeanServer().isRegistered(namingServiceObjectName)) { + if (namingServiceObjectName != null && getMBeanServer().isRegistered(namingServiceObjectName)) { LOG.debug("Stopping MBean {}", namingServiceObjectName); getMBeanServer().invoke(namingServiceObjectName, "stop", null, null); LOG.debug("Unregistering MBean {}", namingServiceObjectName);