is the problem that the
ActiveMQInitialContextFactory returns a regular connection factory rather
than an XA capable one. You may want to extend the
ActiveMQInitialContextFactory to override the createConnectionFactory()
method to return an XA variant or see if you can explicitly provide the
connection factory reference.
Either through configuration of by default the createConnectionFactory
should be capable of returning an XA connection factory. I think by defaut
it would make sense. Can you raise a JIRA for this an if you find that this
is the root cause of your problem.


2009/11/25 miten <miten.me...@morganstanley.com>

>
> Hi,
>
> I am able to get things to work without global transaction.  With JBOSS I
> am
> getting "javax.jms.JMSException: Session's XAResource has not been enlisted
> in a distributed transaction."
>
> using the spring config as below:
> =========================
> <bean id="myMessageListener" class="jmsexample.ExampleListener" />
> <bean id="jndiTemplate" class="org.springframework.jndi.JndiTemplate">
>    <property name="environment">
>      <props>
>        <prop key="java.naming.factory.initial">
>          org.apache.activemq.jndi.ActiveMQInitialContextFactory
>        </prop>
>        <prop key="queue.TEST.Q1">
>          TEST.Q1
>        </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.apache.activemq.ActiveMQXAConnectionFactory">
>        <property name="brokerURL">
>           <value>tcp://localhost:61616</value>
>        </property>
>    </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"/>
>
> </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>
>
>
> Regards,
>
> Miten.
> --
> View this message in context:
> http://old.nabble.com/xa-jta-activemq-jboss-tp26515685p26515685.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>
>


-- 
http://blog.garytully.com

Open Source Integration
http://fusesource.com

Reply via email to