activemq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Edwin van der Elst (JIRA)" <>
Subject [jira] Created: (AMQ-2676) Exception sending to an ActiveMQ queue from JBoss in an XA Transaction
Date Fri, 26 Mar 2010 13:55:08 GMT
Exception sending to an ActiveMQ queue from JBoss in an XA Transaction

                 Key: AMQ-2676
             Project: ActiveMQ
          Issue Type: Bug
          Components: Connector
    Affects Versions: 5.3.0
            Reporter: Edwin van der Elst

We are trying to use an inbound and outbound queue on a remote ActiveMQ instance using XA
Receiving seems to work ok, but when we send a message, the ActiveMQ RA gives an exception
saying that the session is not 'enlisted to a distributed transaction'.

If we use JBoss Messaging, there is no exception, but the thread on this forum
gives me the impression that JBMQ just works without the transaction in that situation, without
throwing an exception.

To work around a classcastexception on the QueueConnectionFactory we use a patched version
of the activemq-rar-adapter (see also

his is the test application & configuration.

To set it up, a regular JBoss 5.1.0-GA can be used (compiled for java 6).

Changes in configuration:
- unzipped activemq-rar (5.3.0), with the new class I wrote as a 'hack'.
The ra.xml is attached to this message, as is the replacement for the jar 

 jbossts-properties.xml - Has the ActiveMQProvider registered for XA recovery purposes

 activemq-jms-ds.xml, must be placed in the deploy folder

Test application:

I commented out the persistence stuff, that is not related to the issue.
The application deploys a MDB and a SLSB. For running the test, you need an ActiveMQ instance
on localhost :61616 (default)
To get the error, you can call the SLSB directly (see, put jboss-all-client.jar
on the cp and the ejbjar).
The helloWorld method sends to ActiveMQ.
The sendJBoss method uses a JBoss Messaging Queue (this doesn't give the Exception, but I'm
not sure that this means it actually runs in a XA transaction)

To deploy the JBoss queue, you need to add this fragment to the 'deploy/messaging/destinations-service.xml':
  <mbean code="org.jboss.jms.server.destination.QueueService"
     <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>

The rar_performance.ear is the compiled testcase.
To rebuild, unzip the 'simple_ejb_testcase' and perform a mvn install in te 'simple_mdb' folder
and in the 'simple_mdb_ear' folder (there is no parent pom.xml).

The exception:
11:56:28,851 ERROR [STDERR] javax.jms.JMSException: Session's XAResource has not been enlisted
in a distributed transaction.
11:56:28,852 ERROR [STDERR]     at org.apache.activemq.ActiveMQXASession.doStartTransaction(
11:56:28,852 ERROR [STDERR]     at org.apache.activemq.ActiveMQSession.send(
11:56:28,852 ERROR [STDERR]     at org.apache.activemq.ActiveMQMessageProducer.send(
11:56:28,852 ERROR [STDERR]     at org.apache.activemq.ActiveMQMessageProducerSupport.send(
11:56:28,852 ERROR [STDERR]     at gts.ise.refdata.domain.complexinstrument.HelloBean.helloWorld(
11:56:28,852 ERROR [STDERR]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
11:56:28,852 ERROR [STDERR]     at sun.reflect.NativeMethodAccessorImpl.invoke(
11:56:28,852 ERROR [STDERR]     at sun.reflect.DelegatingMethodAccessorImpl.invoke(
11:56:28,852 ERROR [STDERR]     at java.lang.reflect.Method.invoke(

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message