activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jmychasiw <jmycha...@gmail.com>
Subject Active MQ 5.1 + XA Transactions + Spring
Date Thu, 11 Sep 2008 17:38:59 GMT

Greetings:
We are in the early stages of proofing a messaging solution for our
application.  
We have chosen ActiveMQ 5.1 for our initial tests, along with Spring 2.5 and
Java 1.5

In development we currently run our application on Jetty 6.x and Atomikos
3.2.3 for XAtransaction management.
In production we use OC4J 10.1.3

We would appreciate some guidance on the correct configuration

At this time we are getting an when sending a message:

Caused by: javax.jms.JMSException: Cannot commit() inside XASession
        at
org.jencks.pool.PooledSpringXASession.commit(PooledSpringXASession.java:119)
        at
org.springframework.jms.connection.JmsResourceHolder.commitAll(JmsResourceHolder.java:182)



Our current config is using Jetty/atomikos (we have not yet tried Oracle):

<bean id="atomikosTransactionManager"
class="com.atomikos.icatch.jta.UserTransactionManager" init-method="init"
destroy-method="close">
	<property name="forceShutdown"><value>true</value></property>
	<property name="transactionTimeout"><value>600</value></property>
</bean>

<bean id="atomikosUserTransaction"
class="com.atomikos.icatch.jta.UserTransactionImp" />

<bean id="transactionManager"
class="org.springframework.transaction.jta.JtaTransactionManager">
	<property name="transactionManager"><ref bean="atomikosTransactionManager" 
/></property>
	<property name="userTransaction"><ref bean="atomikosUserTransaction" 
/></property>
</bean>

<bean id="jmsConnectionFactory"
class="org.jencks.pool.PooledSpringXAConnectionFactory">		 
  <property name="connectionFactory">
    <bean class="org.apache.activemq.ActiveMQXAConnectionFactory">
	<property name="brokerURL" value="tcp://localhost:61616"/>
    </bean>
  </property>
		
  <property name="jtaTransactionManager" ref="transactionManager"/>
</bean>

<bean id="destination" class="org.apache.activemq.command.ActiveMQQueue">
	<constructor-arg index="0">
		<value>queue.sysMessage</value>
	</constructor-arg>
</bean>

<bean id="jmsTemplate" class="org.springframework.jms.core.JmsTemplate">
	<property name="connectionFactory" ref="jmsConnectionFactory"/>
	<property name="defaultDestination" ref="destination"/>
	<property name="sessionTransacted" value="true" /> <!--  just for atomikos
-->
</bean>
	
<jms:listener-container container-type="default"
connection-factory="jmsConnectionFactory"
transaction-manager="transactionManager">
   <jms:listener destination="queue.sysMessage" ref="systemAdminService"
method="processGlobalMessage" />
</jms:listener-container>

Thanks..

-- 
View this message in context: http://www.nabble.com/Active-MQ-5.1-%2B-XA-Transactions-%2B-Spring-tp19440342p19440342.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Mime
View raw message