Atomikos Forum

All feedback will be investigated, but priority support, confidential support, and product priority updates are reserved for customers. Interested in becoming a customer? Subscribe here...

Only registered users can post (registration is free). Problems registering? Send an email to support@atomikos.com to get help.


Atomikos not working with OracleXA Datasource throwing JTA Exc

org.apache.camel.RuntimeCamelException: org.springframework.transaction.UnexpectedRollbackException: JTA transaction unexpectedly rolled back (maybe due to a timeout); nested exception is javax.transaction.RollbackException: The transaction was set to rollback only
    at org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHelper.java:1690) ~[camel-core-2.17.6.jar:2.17.6]
    at org.apache.camel.component.jms.EndpointMessageListener$EndpointMessageListenerAsyncCallback.done(EndpointMessageListener.java:195) ~[camel-jms-2.16.3.jar:2.16.3]
    at org.apache.camel.component.jms.EndpointMessageListener.onMessage(EndpointMessageListener.java:116) ~[camel-jms-2.16.3.jar:2.16.3]
    at org.springframework.jms.listener.AbstractMessageListenerContainer.doInvokeListener(AbstractMessageListenerContainer.java:721) ~[spring-jms-4.3.6.RELEASE.jar:4.3.6.RELEASE]
    at org.springframework.jms.listener.AbstractMessageListenerContainer.invokeListener(AbstractMessageListenerContainer.java:681) ~[spring-jms-4.3.6.RELEASE.jar:4.3.6.RELEASE]
    at org.springframework.jms.listener.AbstractMessageListenerContainer.doExecuteListener(AbstractMessageListenerContainer.java:651) ~[spring-jms-4.3.6.RELEASE.jar:4.3.6.RELEASE]
    at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.doReceiveAndExecute(AbstractPollingMessageListenerContainer.java:317) [spring-jms-4.3.6.RELEASE.jar:4.3.6.RELEASE]

Caused by: javax.transaction.RollbackException: The transaction was set to rollback only
    at com.atomikos.icatch.jta.TransactionImp.rethrowAsJtaRollbackException(TransactionImp.java:66) ~[transactions-jta-3.9.3.jar:na]
    at com.atomikos.icatch.jta.TransactionImp.commit(TransactionImp.java:206) ~[transactions-jta-3.9.3.jar:na]
    at com.atomikos.icatch.jta.TransactionManagerImp.commit(TransactionManagerImp.java:436) ~[transactions-jta-3.9.3.jar:na]
    at com.atomikos.icatch.jta.UserTransactionImp.commit(UserTransactionImp.java:107) ~[transactions-jta-3.9.3.jar:na]





Hibernate is not flushing the session and exception is not being caught.


Configuration Details:
=========================



  <bean id="atomikosTransactionManager" class="com.atomikos.icatch.jta.UserTransactionManager" init-method="init"
          destroy-method="close" depends-on="xaDataSource,proxyXAMqCF,jmsMqCF">
        <property name="forceShutdown" value="true"/>
        <property name="startupTransactionService" value="true"/>       
        <property name="transactionTimeout" value="600"/>
</bean>


  <bean id="atomikosUserTransaction" class="com.atomikos.icatch.jta.UserTransactionImp">
        <property name="transactionTimeout" value="300"/>
    </bean>
    <bean id="jtaTransactionManager" class="org.springframework.transaction.jta.JtaTransactionManager">
        <property name="transactionManager" ref="atomikosTransactionManager"/>
        <property name="userTransaction" ref="atomikosUserTransaction"/>
    </bean>

    <!-- JMS Connection Factory -->
    <bean id="jmsMqCF" class="com.atomikos.jms.AtomikosConnectionFactoryBean" init-method="init"
          destroy-method="close" primary="true">
        <property name="uniqueResourceName" value="myUniqueResource"/>
        <property name="xaConnectionFactory" ref="proxyXAMqCF"/>
        <property name="maxPoolSize" value="100"/>
    </bean>
    <!-- XA JMS Connection Factory -->
    <bean id="proxyXAMqCF" class="org.apache.activemq.ActiveMQXAConnectionFactory">
        <property name="brokerURL" value="tcp://localhost:61616"/>
    </bean>

    <bean id="brokerManagementContext" class="org.apache.activemq.broker.jmx.ManagementContext">
    </bean>
   
   
    <bean class="org.springframework.jms.core.JmsTemplate" id="jmsTemplate">
        <property name="connectionFactory" ref="proxyXAMqCF"/>
        <property name="receiveTimeout" value="2000"/>
        <!-- "sessionTransacted" has to be set to "true" to start an transaction for every incoming JMS message -->
        <property name="sessionTransacted" value="true"/>
        <!-- sessionAcknowledgeMode has to be set to javax.jms.Session.SESSION_TRANSACTED -->
        <property name="sessionAcknowledgeMode" value="0"/>
    </bean>
   

   
<bean class="org.apache.activemq.camel.component.ActiveMQComponent" id="activemq">
        <property name="connectionFactory" ref="proxyXAMqCF"/>
        <property name="transacted" value="false"/>
</bean>



Please let me know am I missing some configuration here
Bharathy Poovalingam Send private email
woensdag 12 april 2017
 
 

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics
 
Powered by FogBugz