activemq-dev mailing list archives

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

     [ https://issues.apache.org/activemq/browse/AMQ-2676?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Edwin van der Elst updated AMQ-2676:
------------------------------------

    Attachment: jbossts-properties.xml
                activemq-jms-ds.xml
                activemq-ra-5.3.0.jar

> Exception sending to an ActiveMQ queue from JBoss in an XA Transaction
> ----------------------------------------------------------------------
>
>                 Key: AMQ-2676
>                 URL: https://issues.apache.org/activemq/browse/AMQ-2676
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: Connector
>    Affects Versions: 5.3.0
>            Reporter: Edwin van der Elst
>         Attachments: activemq-jms-ds.xml, activemq-ra-5.3.0.jar, jbossts-properties.xml,
ra.xml, rar_performance.ear, simpl_ejb_testcase.zip
>
>
> We are trying to use an inbound and outbound queue on a remote ActiveMQ instance using
XA transactions.
> 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 http://community.jboss.org/thread/149573
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 https://issues.apache.org/activemq/browse/AMQ-2670).
> 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 Test.java, 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"
>      name="jboss.messaging.destination:service=Queue,name=DemoQueue"
>      xmbean-dd="xmdesc/Queue-xmbean.xml">
>      <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
>      <depends>jboss.messaging:service=PostOffice</depends>
>   </mbean>
> 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(ActiveMQXASession.java:109)
> 11:56:28,852 ERROR [STDERR]     at org.apache.activemq.ActiveMQSession.send(ActiveMQSession.java:1636)
> 11:56:28,852 ERROR [STDERR]     at org.apache.activemq.ActiveMQMessageProducer.send(ActiveMQMessageProducer.java:231)
> 11:56:28,852 ERROR [STDERR]     at org.apache.activemq.ActiveMQMessageProducerSupport.send(ActiveMQMessageProducerSupport.java:241)
> 11:56:28,852 ERROR [STDERR]     at gts.ise.refdata.domain.complexinstrument.HelloBean.helloWorld(HelloBean.java:46)
> 11:56:28,852 ERROR [STDERR]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
Method)
> 11:56:28,852 ERROR [STDERR]     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> 11:56:28,852 ERROR [STDERR]     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> 11:56:28,852 ERROR [STDERR]     at java.lang.reflect.Method.invoke(Method.java:597)

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


Mime
View raw message