Details
-
Bug
-
Status: Open
-
Minor
-
Resolution: Unresolved
-
jmx-core-1.1.0
-
None
-
None
-
jmx-core-1.1.1
Description
I'm just starting to use Aries JMX Whiteboard but the first thing to struck me was an innocent but yet disturbing error message.
[INFO] [org.visit] Registering org.osgi.jmx.service.cm.ConfigurationAdminMBean to MBeanServer com.sun.jmx.mbeanserver.JmxMBeanServer@82a72a with name osgi.compendium:service=cm,version=1.3,framework=org.apache.felix.framework,uuid=c16979bc-e552-4a51-8763-a41d385589c8 [INFO] [org.visit] Registering org.osgi.jmx.framework.FrameworkMBean to MBeanServer com.sun.jmx.mbeanserver.JmxMBeanServer@82a72a with name osgi.core:type=framework,version=1.7,framework=org.apache.felix.framework,uuid=c16979bc-e552-4a51-8763-a41d385589c8 [INFO] [org.visit] Registering org.osgi.jmx.service.cm.ConfigurationAdminMBean to MBeanServer com.sun.jmx.mbeanserver.JmxMBeanServer@82a72a with name osgi.compendium:service=cm,version=1.3,framework=org.apache.felix.framework,uuid=c16979bc-e552-4a51-8763-a41d385589c8 [WARNING] [org.visit] MBean is already registered org.apache.felix.log.LogException: javax.management.InstanceAlreadyExistsException: osgi.compendium:service=cm,version=1.3,framework=org.apache.felix.framework,uuid=c16979bc-e552-4a51-8763-a41d385589c8 at com.sun.jmx.mbeanserver.Repository.addMBean(Repository.java:437) at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerWithRepository(DefaultMBeanServerInterceptor.java:1898) at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerDynamicMBean(DefaultMBeanServerInterceptor.java:966) at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerObject(DefaultMBeanServerInterceptor.java:900) at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerMBean(DefaultMBeanServerInterceptor.java:324) at com.sun.jmx.mbeanserver.JmxMBeanServer.registerMBean(JmxMBeanServer.java:522) at org.apache.aries.jmx.agent.JMXAgentImpl.registerMBean(.:194) at org.apache.aries.jmx.agent.JMXAgentContext.registerMBean(.:74) at org.apache.aries.jmx.AbstractCompendiumHandler$1.run(.:91)
It seems that JMXAgentImpl is not keeping track on which server it has registered which mbean instance so it tries to register already registered beans again. With a small effort, the current mbeans handlers tracking table could be changed to contain mbean servers instead of a simple flag indicating whether mbean has been registered or not.