You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@activemq.apache.org by "Miten Mehta (JIRA)" <ji...@apache.org> on 2009/11/26 12:35:52 UTC

[jira] Created: (AMQ-2514) xa jta activemq jboss - xa transaction not set in session

xa jta activemq jboss - xa transaction not set in session
---------------------------------------------------------

                 Key: AMQ-2514
                 URL: https://issues.apache.org/activemq/browse/AMQ-2514
             Project: ActiveMQ
          Issue Type: Bug
          Components: Broker
    Affects Versions: 5.3.0
         Environment: JBossTS 4.2.3 SP5, activemq 5.3.0, jdk1.6.0_16, winxp, spring 2.5.6, hp desktop
            Reporter: Miten Mehta


JBoss based global transaction does not work with active mq.  The session for say jms though is ActiveMQXASession getting created but its transaction related values are not set at all due to which even after retrieving the message it fails after doing check for whether its transaction context is set or not.  It will give JMS Exception as "Session's XAResource has not been enlisted in a distributed transaction.".

You can find the thread on nabble at:
http://old.nabble.com/xa-jta-activemq-jboss-td26515685.html#a26516734

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


[jira] Updated: (AMQ-2514) xa jta activemq jboss - xa transaction not set in session

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

Miten Mehta updated AMQ-2514:
-----------------------------

    Description: 
JBoss based global transaction does not work with active mq.  The session for say jms though is ActiveMQXASession getting created but its transaction related values are not set at all due to which even after retrieving the message it fails after doing check for whether its transaction context is set or not.  It will give JMS Exception as "Session's XAResource has not been enlisted in a distributed transaction.".

You can find the thread on nabble at:
http://old.nabble.com/xa-jta-activemq-jboss-td26515685.html#a26527052

  was:
JBoss based global transaction does not work with active mq.  The session for say jms though is ActiveMQXASession getting created but its transaction related values are not set at all due to which even after retrieving the message it fails after doing check for whether its transaction context is set or not.  It will give JMS Exception as "Session's XAResource has not been enlisted in a distributed transaction.".

You can find the thread on nabble at:
http://old.nabble.com/xa-jta-activemq-jboss-td26515685.html#a26516734


changed the nabble thread url.

> xa jta activemq jboss - xa transaction not set in session
> ---------------------------------------------------------
>
>                 Key: AMQ-2514
>                 URL: https://issues.apache.org/activemq/browse/AMQ-2514
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: Broker
>    Affects Versions: 5.3.0
>         Environment: JBossTS 4.2.3 SP5, activemq 5.3.0, jdk1.6.0_16, winxp, spring 2.5.6, hp desktop
>            Reporter: Miten Mehta
>
> JBoss based global transaction does not work with active mq.  The session for say jms though is ActiveMQXASession getting created but its transaction related values are not set at all due to which even after retrieving the message it fails after doing check for whether its transaction context is set or not.  It will give JMS Exception as "Session's XAResource has not been enlisted in a distributed transaction.".
> You can find the thread on nabble at:
> http://old.nabble.com/xa-jta-activemq-jboss-td26515685.html#a26527052

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


[jira] Commented: (AMQ-2514) xa jta activemq jboss - xa transaction not set in session

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

Gary Tully commented on AMQ-2514:
---------------------------------

Think the answer is somewhere in here: http://static.springsource.org/spring/docs/2.5.x/reference/transaction.html
from the AMQ perspective, all it can do is present an XA capable connection factory. 
The key component that is missing is some wrapper around the connection factory that will enlist connections and sessions in the current XA transaction. This needs to be managed by spring in some way but it probably needs some directive or annotation to make this happen. In the case of jboss using CMT, jboss would provide the wrapper around the Activemq JMS connection factory and ensure that it is enlisted.

> xa jta activemq jboss - xa transaction not set in session
> ---------------------------------------------------------
>
>                 Key: AMQ-2514
>                 URL: https://issues.apache.org/activemq/browse/AMQ-2514
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: Broker
>    Affects Versions: 5.3.0
>         Environment: JBossTS 4.2.3 SP5, activemq 5.3.0, jdk1.6.0_16, winxp, spring 2.5.6, hp desktop
>            Reporter: Miten Mehta
>
> JBoss based global transaction does not work with active mq.  The session for say jms though is ActiveMQXASession getting created but its transaction related values are not set at all due to which even after retrieving the message it fails after doing check for whether its transaction context is set or not.  It will give JMS Exception as "Session's XAResource has not been enlisted in a distributed transaction.".
> You can find the thread on nabble at:
> http://old.nabble.com/xa-jta-activemq-jboss-td26515685.html#a26527052
> Note that I have also set the cacheLevel in config below which by default is set with same value in 2.5.6 api.  Setting cache level does not resolve the issue.  The nabble message thread has the earlier configs if one wants to read in complete.
> <?xml version="1.0" encoding="UTF-8"?>
> <beans 
>   xmlns="http://www.springframework.org/schema/beans"
>   xmlns:util="http://www.springframework.org/schema/util"
>   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>   xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
>                       http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.0.xsd"
>   >
>   
>  
> <!-- this is the Message Driven POJO (MDP) -->
> <bean id="myMessageListener" class="jmsexample.ExampleListener" />
> <bean id="jndiTemplate" class="org.springframework.jndi.JndiTemplate">
>     <property name="environment">
>       <props>
>         <prop key="java.naming.factory.initial">
>           jmsexample.jndi.ActiveMQInitialContextFactory
>         </prop>
>         <prop key="queue.TEST.Q1">
>           TEST.Q1
>         </prop>
>        
>         <prop key="brokerURL">
>            tcp://localhost:61616
>         </prop>
>       </props>
>     </property>
>   </bean>
>  <bean id="appJmsDestination"
>     class="org.springframework.jndi.JndiObjectFactoryBean">
>     <property name="jndiTemplate">
>       <ref bean="jndiTemplate"/>
>     </property>
>     <property name="jndiName" value="TEST.Q1"/>
>   </bean>
>  
>  <bean id="connectionFactory"
>     class="org.springframework.jndi.JndiObjectFactoryBean">
>     <property name="jndiTemplate">
>       <ref bean="jndiTemplate"/>
>     </property>
>     <property name="jndiName" value="ConnectionFactory"/>
>   </bean>
>  
> <bean id="jmsContainer" class="org.springframework.jms.listener.DefaultMessageListenerContainer">
>     <property name="connectionFactory" ref="connectionFactory"/>
>     <property name="destination" ref="appJmsDestination"/>
>     <property name="messageListener" ref="myMessageListener" />
>     <property name="transactionManager" ref="transactionManager"/>
>    <property name="cacheLevel">
>       <util:constant static-field="org.springframework.jms.listener.DefaultMessageListenerContainer.CACHE_NONE" />
>     </property>
> </bean>
>  
>  <bean id="jbossTransactionManager"
>     class="com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionManagerImple">
>   </bean>
>   <bean id="jbossUserTransaction"
>     class="com.arjuna.ats.internal.jta.transaction.arjunacore.UserTransactionImple"/>
>   <bean id="transactionManager"
>     class="org.springframework.transaction.jta.JtaTransactionManager">
>     <property name="transactionManager">
>       <ref bean="jbossTransactionManager" />
>     </property>
>     <property name="userTransaction">
>       <ref bean="jbossUserTransaction" />
>     </property>
>   </bean>
>    
> </beans> 

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


[jira] Updated: (AMQ-2514) xa jta activemq jboss - xa transaction not set in session

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

Miten Mehta updated AMQ-2514:
-----------------------------

    Description: 
JBoss based global transaction does not work with active mq.  The session for say jms though is ActiveMQXASession getting created but its transaction related values are not set at all due to which even after retrieving the message it fails after doing check for whether its transaction context is set or not.  It will give JMS Exception as "Session's XAResource has not been enlisted in a distributed transaction.".

You can find the thread on nabble at:
http://old.nabble.com/xa-jta-activemq-jboss-td26515685.html#a26527052

Note that I have also set the cacheLevel in config below which by default is set with same value in 2.5.6 api.  Setting cache level does not resolve the issue.  The nabble message thread has the earlier configs if one wants to read in complete.

<?xml version="1.0" encoding="UTF-8"?>
<beans 
  xmlns="http://www.springframework.org/schema/beans"
  xmlns:util="http://www.springframework.org/schema/util"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
                      http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.0.xsd"
  >
  
 
<!-- this is the Message Driven POJO (MDP) -->
<bean id="myMessageListener" class="jmsexample.ExampleListener" />
<bean id="jndiTemplate" class="org.springframework.jndi.JndiTemplate">
    <property name="environment">
      <props>
        <prop key="java.naming.factory.initial">
          jmsexample.jndi.ActiveMQInitialContextFactory
        </prop>
        <prop key="queue.TEST.Q1">
          TEST.Q1
        </prop>
       
        <prop key="brokerURL">
           tcp://localhost:61616
        </prop>
      </props>
    </property>
  </bean>
 <bean id="appJmsDestination"
    class="org.springframework.jndi.JndiObjectFactoryBean">
    <property name="jndiTemplate">
      <ref bean="jndiTemplate"/>
    </property>
    <property name="jndiName" value="TEST.Q1"/>
  </bean>
 
 <bean id="connectionFactory"
    class="org.springframework.jndi.JndiObjectFactoryBean">
    <property name="jndiTemplate">
      <ref bean="jndiTemplate"/>
    </property>
    <property name="jndiName" value="ConnectionFactory"/>
  </bean>
 

<bean id="jmsContainer" class="org.springframework.jms.listener.DefaultMessageListenerContainer">
    <property name="connectionFactory" ref="connectionFactory"/>
    <property name="destination" ref="appJmsDestination"/>
    <property name="messageListener" ref="myMessageListener" />
    <property name="transactionManager" ref="transactionManager"/>
   <property name="cacheLevel">
      <util:constant static-field="org.springframework.jms.listener.DefaultMessageListenerContainer.CACHE_NONE" />
    </property>
</bean>

 
 <bean id="jbossTransactionManager"
    class="com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionManagerImple">
  </bean>

  <bean id="jbossUserTransaction"
    class="com.arjuna.ats.internal.jta.transaction.arjunacore.UserTransactionImple"/>

  <bean id="transactionManager"
    class="org.springframework.transaction.jta.JtaTransactionManager">
    <property name="transactionManager">
      <ref bean="jbossTransactionManager" />
    </property>
    <property name="userTransaction">
      <ref bean="jbossUserTransaction" />
    </property>
  </bean>
   
</beans> 

  was:
JBoss based global transaction does not work with active mq.  The session for say jms though is ActiveMQXASession getting created but its transaction related values are not set at all due to which even after retrieving the message it fails after doing check for whether its transaction context is set or not.  It will give JMS Exception as "Session's XAResource has not been enlisted in a distributed transaction.".

You can find the thread on nabble at:
http://old.nabble.com/xa-jta-activemq-jboss-td26515685.html#a26527052


As suggested I am posting the spring config.  


> xa jta activemq jboss - xa transaction not set in session
> ---------------------------------------------------------
>
>                 Key: AMQ-2514
>                 URL: https://issues.apache.org/activemq/browse/AMQ-2514
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: Broker
>    Affects Versions: 5.3.0
>         Environment: JBossTS 4.2.3 SP5, activemq 5.3.0, jdk1.6.0_16, winxp, spring 2.5.6, hp desktop
>            Reporter: Miten Mehta
>
> JBoss based global transaction does not work with active mq.  The session for say jms though is ActiveMQXASession getting created but its transaction related values are not set at all due to which even after retrieving the message it fails after doing check for whether its transaction context is set or not.  It will give JMS Exception as "Session's XAResource has not been enlisted in a distributed transaction.".
> You can find the thread on nabble at:
> http://old.nabble.com/xa-jta-activemq-jboss-td26515685.html#a26527052
> Note that I have also set the cacheLevel in config below which by default is set with same value in 2.5.6 api.  Setting cache level does not resolve the issue.  The nabble message thread has the earlier configs if one wants to read in complete.
> <?xml version="1.0" encoding="UTF-8"?>
> <beans 
>   xmlns="http://www.springframework.org/schema/beans"
>   xmlns:util="http://www.springframework.org/schema/util"
>   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>   xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
>                       http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.0.xsd"
>   >
>   
>  
> <!-- this is the Message Driven POJO (MDP) -->
> <bean id="myMessageListener" class="jmsexample.ExampleListener" />
> <bean id="jndiTemplate" class="org.springframework.jndi.JndiTemplate">
>     <property name="environment">
>       <props>
>         <prop key="java.naming.factory.initial">
>           jmsexample.jndi.ActiveMQInitialContextFactory
>         </prop>
>         <prop key="queue.TEST.Q1">
>           TEST.Q1
>         </prop>
>        
>         <prop key="brokerURL">
>            tcp://localhost:61616
>         </prop>
>       </props>
>     </property>
>   </bean>
>  <bean id="appJmsDestination"
>     class="org.springframework.jndi.JndiObjectFactoryBean">
>     <property name="jndiTemplate">
>       <ref bean="jndiTemplate"/>
>     </property>
>     <property name="jndiName" value="TEST.Q1"/>
>   </bean>
>  
>  <bean id="connectionFactory"
>     class="org.springframework.jndi.JndiObjectFactoryBean">
>     <property name="jndiTemplate">
>       <ref bean="jndiTemplate"/>
>     </property>
>     <property name="jndiName" value="ConnectionFactory"/>
>   </bean>
>  
> <bean id="jmsContainer" class="org.springframework.jms.listener.DefaultMessageListenerContainer">
>     <property name="connectionFactory" ref="connectionFactory"/>
>     <property name="destination" ref="appJmsDestination"/>
>     <property name="messageListener" ref="myMessageListener" />
>     <property name="transactionManager" ref="transactionManager"/>
>    <property name="cacheLevel">
>       <util:constant static-field="org.springframework.jms.listener.DefaultMessageListenerContainer.CACHE_NONE" />
>     </property>
> </bean>
>  
>  <bean id="jbossTransactionManager"
>     class="com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionManagerImple">
>   </bean>
>   <bean id="jbossUserTransaction"
>     class="com.arjuna.ats.internal.jta.transaction.arjunacore.UserTransactionImple"/>
>   <bean id="transactionManager"
>     class="org.springframework.transaction.jta.JtaTransactionManager">
>     <property name="transactionManager">
>       <ref bean="jbossTransactionManager" />
>     </property>
>     <property name="userTransaction">
>       <ref bean="jbossUserTransaction" />
>     </property>
>   </bean>
>    
> </beans> 

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


[jira] Updated: (AMQ-2514) xa jta activemq jboss - xa transaction not set in session

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

Bruce Snyder updated AMQ-2514:
------------------------------

    Fix Version/s: 5.5.0
                       (was: 5.4.1)

> xa jta activemq jboss - xa transaction not set in session
> ---------------------------------------------------------
>
>                 Key: AMQ-2514
>                 URL: https://issues.apache.org/activemq/browse/AMQ-2514
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: Broker
>    Affects Versions: 5.3.0
>         Environment: JBossTS 4.2.3 SP5, activemq 5.3.0, jdk1.6.0_16, winxp, spring 2.5.6, hp desktop
>            Reporter: Miten Mehta
>             Fix For: 5.5.0
>
>
> JBoss based global transaction does not work with active mq.  The session for say jms though is ActiveMQXASession getting created but its transaction related values are not set at all due to which even after retrieving the message it fails after doing check for whether its transaction context is set or not.  It will give JMS Exception as "Session's XAResource has not been enlisted in a distributed transaction.".
> You can find the thread on nabble at:
> http://old.nabble.com/xa-jta-activemq-jboss-td26515685.html#a26527052
> Note that I have also set the cacheLevel in config below which by default is set with same value in 2.5.6 api.  Setting cache level does not resolve the issue.  The nabble message thread has the earlier configs if one wants to read in complete.
> <?xml version="1.0" encoding="UTF-8"?>
> <beans 
>   xmlns="http://www.springframework.org/schema/beans"
>   xmlns:util="http://www.springframework.org/schema/util"
>   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>   xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
>                       http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.0.xsd"
>   >
>   
>  
> <!-- this is the Message Driven POJO (MDP) -->
> <bean id="myMessageListener" class="jmsexample.ExampleListener" />
> <bean id="jndiTemplate" class="org.springframework.jndi.JndiTemplate">
>     <property name="environment">
>       <props>
>         <prop key="java.naming.factory.initial">
>           jmsexample.jndi.ActiveMQInitialContextFactory
>         </prop>
>         <prop key="queue.TEST.Q1">
>           TEST.Q1
>         </prop>
>        
>         <prop key="brokerURL">
>            tcp://localhost:61616
>         </prop>
>       </props>
>     </property>
>   </bean>
>  <bean id="appJmsDestination"
>     class="org.springframework.jndi.JndiObjectFactoryBean">
>     <property name="jndiTemplate">
>       <ref bean="jndiTemplate"/>
>     </property>
>     <property name="jndiName" value="TEST.Q1"/>
>   </bean>
>  
>  <bean id="connectionFactory"
>     class="org.springframework.jndi.JndiObjectFactoryBean">
>     <property name="jndiTemplate">
>       <ref bean="jndiTemplate"/>
>     </property>
>     <property name="jndiName" value="ConnectionFactory"/>
>   </bean>
>  
> <bean id="jmsContainer" class="org.springframework.jms.listener.DefaultMessageListenerContainer">
>     <property name="connectionFactory" ref="connectionFactory"/>
>     <property name="destination" ref="appJmsDestination"/>
>     <property name="messageListener" ref="myMessageListener" />
>     <property name="transactionManager" ref="transactionManager"/>
>    <property name="cacheLevel">
>       <util:constant static-field="org.springframework.jms.listener.DefaultMessageListenerContainer.CACHE_NONE" />
>     </property>
> </bean>
>  
>  <bean id="jbossTransactionManager"
>     class="com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionManagerImple">
>   </bean>
>   <bean id="jbossUserTransaction"
>     class="com.arjuna.ats.internal.jta.transaction.arjunacore.UserTransactionImple"/>
>   <bean id="transactionManager"
>     class="org.springframework.transaction.jta.JtaTransactionManager">
>     <property name="transactionManager">
>       <ref bean="jbossTransactionManager" />
>     </property>
>     <property name="userTransaction">
>       <ref bean="jbossUserTransaction" />
>     </property>
>   </bean>
>    
> </beans> 

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


[jira] Commented: (AMQ-2514) xa jta activemq jboss - xa transaction not set in session

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

Gary Tully commented on AMQ-2514:
---------------------------------

post your spring xml here also, it may help to tie it together. Did you notice: "NOTE: Turn off the "cacheSessions" flag on JBoss 4.0 to make JMS message reception properly participate in XA transactions, where JBoss requires each listener thread to reobtain its JMS Session for each receive attempt." from http://www.jdocs.com/spring/2.0.RC1/org/springframework/jms/listener/DefaultMessageListenerContainer.html - wonder if that is relevant.



> xa jta activemq jboss - xa transaction not set in session
> ---------------------------------------------------------
>
>                 Key: AMQ-2514
>                 URL: https://issues.apache.org/activemq/browse/AMQ-2514
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: Broker
>    Affects Versions: 5.3.0
>         Environment: JBossTS 4.2.3 SP5, activemq 5.3.0, jdk1.6.0_16, winxp, spring 2.5.6, hp desktop
>            Reporter: Miten Mehta
>
> JBoss based global transaction does not work with active mq.  The session for say jms though is ActiveMQXASession getting created but its transaction related values are not set at all due to which even after retrieving the message it fails after doing check for whether its transaction context is set or not.  It will give JMS Exception as "Session's XAResource has not been enlisted in a distributed transaction.".
> You can find the thread on nabble at:
> http://old.nabble.com/xa-jta-activemq-jboss-td26515685.html#a26527052

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