activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ueli Scheidegger <>
Subject Embedded queue: how to share within 1 VM but 2 web apps?
Date Mon, 14 Apr 2014 09:19:40 GMT
Dear ActiveMQ experts

(Sorry if this get's reposted. Nabble was telling my that my post was not accepted.)

I'm trying to figure out a thing which should be easy according to the docs[1]. 

I have 
- 1 Tomcat (therefore 1 VM)
- 2 webapps

Now I need 1 embedded message queue in this VM which is shared between the two web apps. I
don't create the BrokerService manually but rather use a connection factory in both web apps:

ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory("vm://queuename");

Producing and consuming works fine on one web app. However when I try to do the same on the
second web app I get barked at that the queue already exists:

2014-03-18 14:24:37,540 WARN  : Failed to
start jmx connector: Cannot bind to URL [rmi://localhost:1099/jmxrmi]: javax.naming.NameAlreadyBoundException:
jmxrmi [Root exception is java.rmi.AlreadyBoundException: jmxrmi]. Will restart management
to re-create jmx connector, trying to remedy this issue.
2014-03-18 14:24:37,545 ERROR          : Failed to
start Apache ActiveMQ (queuename, null). Reason:
org.apache.activemq:BrokerName= queuename,Type=Broker org.apache.activemq:BrokerName= queuename,Type=Broker
 at com.sun.jmx.mbeanserver.Repository.addMBean(
 at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerWithRepository(
 at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerDynamicMBean(
 at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerObject(
 at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerMBean(

I also tried with "vm://queuename?create=false" but got an error telling me that the broker
would not exist… So now I'm a bit desperate. Googled high and low but could not find an
answer so far. Therefore any help warmly appreciated!



View raw message