OK so I have narrowed this down to the amq:broker element behaves badly in spring or in spring within JBoss. I changed my broker name to localhost2. Spring or JBoss appears to be registering this mbean twice. Anybody have any ideas on how to fix this?
<amq:broker start="true" brokerName="localhost2" persistent="false" useJmx="true"> <amq:managementContext> <amq:managementContext createConnector="false" /> </amq:managementContext> </amq:broker> <!-- JMS ConnectionFactory to use, configuring the embedded broker using XML --> <amq:connectionFactory id="jmsFactory" brokerURL="vm://localhost"> </amq:connectionFactory> and the result... Caused by: javax.management.InstanceAlreadyExistsException: org.apache.activemq:BrokerName=localhost2,Type=Broker already registered. at org.jboss.mx.server.registry.BasicMBeanRegistry.add(BasicMBeanRegistry.java:761) at org.jboss.mx.server.registry.BasicMBeanRegistry.registerMBean(BasicMBeanRegistry.java:225) at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155) at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94) at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133) at org.jboss.mx.server.Invocation.invoke(Invocation.java:88) at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142) at org.jboss.mx.server.Invocation.invoke(Invocation.java:88) at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264) at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659) at org.jboss.mx.server.MBeanServerImpl$3.run(MBeanServerImpl.java:1422) at java.security.AccessController.doPrivileged(Native Method) at org.jboss.mx.server.MBeanServerImpl.registerMBean(MBeanServerImpl.java:1417) at org.jboss.mx.server.MBeanServerImpl.registerMBean(MBeanServerImpl.java:376) at org.jboss.system.server.jmx.LazyMBeanServer.registerMBean(LazyMBeanServer.java:215) at org.apache.activemq.broker.BrokerService.createBroker(BrokerService.java:1554) at org.apache.activemq.broker.BrokerService.getBroker(BrokerService.java:540) at org.apache.activemq.broker.BrokerService.start(BrokerService.java:444) at org.apache.activemq.xbean.XBeanBrokerService.afterPropertiesSet(XBeanBrokerService.java:50) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1368) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1334) ... 106 more -- View this message in context: http://www.nabble.com/Configuring-Embedded-Broker-with-Spring-JBoss-JMX-issues-tp19761024p19768140.html Sent from the ActiveMQ - User mailing list archive at Nabble.com.