activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christian Posta <christian.po...@gmail.com>
Subject Re: useJmx=false, two brokers, getting exception due to jmx
Date Thu, 12 Sep 2013 17:47:12 GMT
Is it using the config you think it's using?


On Thu, Sep 12, 2013 at 9:25 AM, ariskk <kostas.kougios@googlemail.com>wrote:

> 2 test cases use two brokers. One is configured to not use jmx:
>
> <beans
>                 xmlns="http://www.springframework.org/schema/beans"
>                 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>                 xsi:schemaLocation="
> http://www.springframework.org/schema/beans
> http://www.springframework.org/schema/beans/spring-beans.xsd
>                 http://activemq.apache.org/schema/core
> http://activemq.apache.org/schema/core/activemq-core.xsd">
>
>
>         <bean
>
> class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
>                 <property name="locations">
>                         <value>file:${config.jms}/test.properties</value>
>                 </property>
>         </bean>
>
>
>         <broker xmlns="http://activemq.apache.org/schema/core"
> brokerName="localhosttest" dataDirectory="${activemq.data}" useJmx="false">
>
>                 <managementContext>
>                         <managementContext createConnector="false"
> createMBeanServer="false"/>
>                 </managementContext>
>
>                 <persistenceAdapter>
>                         <kahaDB directory="${activemq.data}/kahadb"/>
>                 </persistenceAdapter>
>
>
>                 <transportConnectors>
>
>                         <transportConnector name="openwire"
>
> uri="tcp://
> 0.0.0.0:61616?maximumConnections=1000&amp;wireformat.maxFrameSize=104857600
> "/>
>                 </transportConnectors>
>         </broker>
> </beans>
>
> But still when both tests run in the same jvm, the 2nd one fails because it
> tries to create the jmx:
>
> Caused by: javax.management.InstanceAlreadyExistsException:
> org.apache.activemq:BrokerName=localhost,Type=Broker
>         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.activemq.broker.jmx.ManagementContext.registerMBean(ManagementContext.java:366)
>         at
>
> org.apache.activemq.broker.jmx.AnnotatedMBean.registerMBean(AnnotatedMBean.java:72)
>         at
>
> org.apache.activemq.broker.BrokerService.startManagementContext(BrokerService.java:2370)
>         at
> org.apache.activemq.broker.BrokerService.start(BrokerService.java:567)
>         at
>
> org.apache.activemq.xbean.XBeanBrokerService.afterPropertiesSet(XBeanBrokerService.java:58)
>         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
>
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1608)
>         at
>
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1549)
>         at
>
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1479)
>         ... 65 more
>
>
> it goes down to BrokerService.isUseJmx() which is called by BrokerService
> but it returns true while in my config is false. Any ideas?
>
>
>
> --
> View this message in context:
> http://activemq.2283324.n4.nabble.com/useJmx-false-two-brokers-getting-exception-due-to-jmx-tp4671456.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>



-- 
*Christian Posta*
http://www.christianposta.com/blog
twitter: @christianposta

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message