if(!MBeanUtil.isRegistered(mbs, objectName)) {
// register only of the named JMXConfigurator has not been previously
// registered. Unregistering an MBean within invocation of itself
// caused jconsole to throw an NPE. (This occurs when the reload* method
// unregisters the
JMXConfigurator jmxConfigurator = new JMXConfigurator((LoggerContext) context, mbs,
objectName);
try {
mbs.registerMBean(jmxConfigurator, objectName);
} catch (Exception e) {
addError("Failed to create mbean", e);