Description
In certain scenarios multiple threads can try to initialize the same openmbean type, which can lead to these type of exceptions.
javax.management.openmbean.OpenDataException: Argument's element itemNames[25]="JMSCorrelationID" duplicates a previous item names.
at javax.management.openmbean.CompositeType.<init>(CompositeType.java:153)
at org.apache.activemq.broker.jmx.OpenTypeSupport$AbstractOpenTypeFactory.createCompositeType(OpenTypeSupport.java:82)
at org.apache.activemq.broker.jmx.OpenTypeSupport$AbstractOpenTypeFactory.getCompositeType(OpenTypeSupport.java:70)
at org.apache.activemq.broker.jmx.OpenTypeSupport.convert(OpenTypeSupport.java:543)
at org.apache.activemq.broker.jmx.DestinationView.browse(DestinationView.java:206)
at org.apache.activemq.broker.jmx.DestinationView.browse(DestinationView.java:186)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at sun.reflect.misc.Trampoline.invoke(MethodUtil.java:75)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at sun.reflect.misc.MethodUtil.invoke(MethodUtil.java:279)
at com.sun.jmx.mbeanserver.StandardMBeanIntrospector.invokeM2(StandardMBeanIntrospector.java:112)
at com.sun.jmx.mbeanserver.StandardMBeanIntrospector.invokeM2(StandardMBeanIntrospector.java:46)
at com.sun.jmx.mbeanserver.MBeanIntrospector.invokeM(MBeanIntrospector.java:237)
at com.sun.jmx.mbeanserver.PerInterface.invoke(PerInterface.java:138)
at com.sun.jmx.mbeanserver.MBeanSupport.invoke(MBeanSupport.java:252)
at javax.management.StandardMBean.invoke(StandardMBean.java:405)
at org.apache.activemq.broker.jmx.AnnotatedMBean.invoke(AnnotatedMBean.java:216)
Creating composite type should be synchronized.