Hi,

All XA capable resources participating in the XA transaction should be enlisted in (and looked up from) the JNDI registry. Your configuration suggests that you are actually connecting to a standalone AMQ server which does not provide JNDI registry.

Would consider running AMQ deployed inside JEE container as a JCA resource.

Also would suggest asking yourself a question if you really need an overhead of the XA transactions - both queues seat on the same resources (#connectionFactory), therefore native/local transaction seems more appropriate.

Have a look here " http://www.infoq.com/presentations/native-transactions-java-spring " for some ideas.

Best regards,
Mario

Mariusz Brylant
[email protected]

gude wrote:
Hello,

I would like to receive a message from a JMS queue and send it into an other
one inside the same XA transaction. But I have the following trace in the
log, while attempting to get the input message :

16:11:45,323 | INFO  | tenerContainer-2 | DefaultMessageListenerContainer  |
.DefaultMessageListenerContainer  750 | Setup of JMS message listener
invoker failed for destination 'queue/transactions-in' - trying to recover.
Cause: Session's XAResource has not been enlisted in a distributed
transaction.

my xbean.xml looks like :

<?xml version="1.0" encoding="UTF-8" ?>

<beans xmlns:jms="http://servicemix.apache.org/jms/1.0";
        xmlns:t1="http://examples/transaction1";>

     <jms:consumer service="t1:t1jmsreceiver"
                 endpoint="t1jmsreceiver"
                 targetService="t1:t1sendtot2"
                 targetEndpoint="t1sendtot2"
                 destinationName="queue/transactions-in"
                 connectionFactory="#connectionFactory"
                 marshaler="#consumerMarshaler"
                 synchronous="true"
                 transacted="xa"
                 sessionAcknowledgeMode="2"/>

     <jms:provider service="t1:t1sendtot2"
                 endpoint="t1sendtot2"
                 destinationName="queue/transactions-checkpoint"
                 connectionFactory="#connectionFactory"/>

     <bean id="connectionFactory"
class="org.apache.activemq.ActiveMQXAConnectionFactory">
         <property name="brokerURL" value="tcp://localhost:61616" />
     </bean>

     <bean id="consumerMarshaler"
class="org.apache.servicemix.jms.endpoints.DefaultConsumerMarshaler">
         <property name="mep" value="http://www.w3.org/2004/08/wsdl/in-only";
/>
         <property name="copyProperties" value="true" />
     </bean>

</beans>

What should I do?

Reply via email to