activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Vinicius Carvalho <java.vinic...@gmail.com>
Subject Can't create tempqueue
Date Tue, 30 Nov 2010 12:13:49 GMT
Hi there! I'm trying to create a temp queue on ActiveMQ 5.1.1, but I'm
getting this exception:

javax.jms.InvalidDestinationException: Cannot use a Temporary destination
from another Connection
at
org.apache.activemq.ActiveMQMessageConsumer.<init>(ActiveMQMessageConsumer.java:160)
at
org.apache.activemq.ActiveMQSession.createConsumer(ActiveMQSession.java:1004)
at
org.apache.activemq.ActiveMQSession.createConsumer(ActiveMQSession.java:948)
at
org.apache.activemq.ActiveMQSession.createConsumer(ActiveMQSession.java:861)
at
org.apache.activemq.ActiveMQSession.createConsumer(ActiveMQSession.java:834)
at
com.ericsson.oss.radio.gsm.topology.services.test.SpringIntegrationTest.findTopologyNodesAsynch(SpringIntegrationTest.java:62)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at
org.springframework.test.context.junit4.SpringTestMethod.invoke(SpringTestMethod.java:160)
at
org.springframework.test.context.junit4.SpringMethodRoadie.runTestMethod(SpringMethodRoadie.java:233)
at
org.springframework.test.context.junit4.SpringMethodRoadie$RunBeforesThenTestThenAfters.run(SpringMethodRoadie.java:333)
at
org.springframework.test.context.junit4.SpringMethodRoadie.runWithRepetitions(SpringMethodRoadie.java:217)
at
org.springframework.test.context.junit4.SpringMethodRoadie.runTest(SpringMethodRoadie.java:197)
at
org.springframework.test.context.junit4.SpringMethodRoadie.run(SpringMethodRoadie.java:143)
at
org.springframework.test.context.junit4.SpringJUnit4ClassRunner.invokeTestMethod(SpringJUnit4ClassRunner.java:160)
at
org.junit.internal.runners.JUnit4ClassRunner.runMethods(JUnit4ClassRunner.java:51)
at
org.junit.internal.runners.JUnit4ClassRunner$1.run(JUnit4ClassRunner.java:44)
at
org.junit.internal.runners.ClassRoadie.runUnprotected(ClassRoadie.java:27)
at org.junit.internal.runners.ClassRoadie.runProtected(ClassRoadie.java:37)
at
org.junit.internal.runners.JUnit4ClassRunner.run(JUnit4ClassRunner.java:42)
at
org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:97)
at
org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:46)
at
org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)


Initially I was trying to use spring JMS support but it seemed that it would
re-create a connection every time, so I moved to a manual approach:


ActiveMQConnection conn = (ActiveMQConnection) connectionFactory
.createConnection();
Session session = conn.createSession(false,
Session.AUTO_ACKNOWLEDGE);
ActiveMQTempQueue queue = new ActiveMQTempQueue("replyQueue");
queue.setConnection(conn);

MessageConsumer consumer = session.createConsumer(queue);
consumer.setMessageListener(this.listener);
conn.start();

The only part being created by spring is the connectionFactory.

I can't get why the session.createConumer is failing since the queue was
created using the exact same connection as the session.

Any ideas?

Regards

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