You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@activemq.apache.org by "Edwin van der Elst (JIRA)" <ji...@apache.org> on 2010/03/26 14:55:08 UTC

[jira] Created: (AMQ-2676) Exception sending to an ActiveMQ queue from JBoss in an XA Transaction

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


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.


[jira] Commented: (AMQ-2676) Exception sending to an ActiveMQ queue from JBoss in an XA Transaction

Posted by "Edwin van der Elst (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/AMQ-2676?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=58517#action_58517 ] 

Edwin van der Elst commented on AMQ-2676:
-----------------------------------------

Yes, it looks like I was too focused on getting the integration with the recovery manager working.
We should probably remove those changes and find another way to get that part working.

> 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.


[jira] Updated: (AMQ-2676) Exception sending to an ActiveMQ queue from JBoss in an XA Transaction

Posted by "Edwin van der Elst (JIRA)" <ji...@apache.org>.
     [ 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.


[jira] Resolved: (AMQ-2676) Exception sending to an ActiveMQ queue from JBoss in an XA Transaction

Posted by "Gary Tully (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/activemq/browse/AMQ-2676?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Gary Tully resolved AMQ-2676.
-----------------------------

         Assignee: Gary Tully
    Fix Version/s: 5.4.0
                       (was: 5.4.1)
       Resolution: Fixed

https://issues.apache.org/activemq/browse/AMQ-2670 sorts this issue out. Please reopen if this is not the case.

> 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
>            Assignee: Gary Tully
>             Fix For: 5.4.0
>
>         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.


[jira] Commented: (AMQ-2676) Exception sending to an ActiveMQ queue from JBoss in an XA Transaction

Posted by "Edwin van der Elst (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/AMQ-2676?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=58478#action_58478 ] 

Edwin van der Elst commented on AMQ-2676:
-----------------------------------------

Test code (client calling a remote session bean):

public class Test {

   public static void main(String arg[]) throws NamingException {
      Hashtable<String, String> props = new Hashtable<String, String>();

      props.put("java.naming.factory.initial", "org.jnp.interfaces.NamingContextFactory");
      props.put("java.naming.factory.url.pkgs","org.jboss.naming:org.jnp.interfaces");
      props.put("java.naming.provider.url","localhost:1099");
      InitialContext context = new InitialContext(props);
      HelloRemote remote = (HelloRemote) context.lookup("/rar_performance/HelloBean/remote");

      remote.helloWorld();
   }
}

> 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.


[jira] Updated: (AMQ-2676) Exception sending to an ActiveMQ queue from JBoss in an XA Transaction

Posted by "Edwin van der Elst (JIRA)" <ji...@apache.org>.
     [ 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: simpl_ejb_testcase.zip
                rar_performance.ear
                ra.xml

> 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.


[jira] Commented: (AMQ-2676) Exception sending to an ActiveMQ queue from JBoss in an XA Transaction

Posted by "Gary Tully (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/activemq/browse/AMQ-2676?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=58484#action_58484 ] 

Gary Tully commented on AMQ-2676:
---------------------------------

with the vanilla 5.3.1 rar, this works fine for me. The rar connection factory is enlisted in the XA transaction. It must be the mods to the rar to support the transaction recovery processing that is problematic.

> 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.