Atomikos Forum

Tomcat , Websphere MQ and Atomikos : Not able to integrate trans

Steps taken :

1. Followed all the steps which mentioned in the link
    http://www.atomikos.com/Documentation/Tomcat7Integration35
    
a. Copied "atomikos-integration-extension-3.7.1-20120529.jar" into TOMCAT_HOME/lib folder.
    
B. server.xml

<Listener className="com.atomikos.tomcat.AtomikosLifecycleListener"/>
    
c.  context.xml
    
    <!-- Atomikos Support for the Tomcat server - register Atomikos as java:comp/UserTransaction -->
    <Transaction factory="com.atomikos.icatch.jta.UserTransactionFactory" />

    <!-- Also register Atomikos TransactionManager as java:comp/env/TransactionManager -->
    <Resource auth="Container" factory="org.apache.naming.factory.BeanFactory"
        name="TransactionManager" type="com.atomikos.icatch.jta.UserTransactionManager" />

    <!-- Spring LoadTimeWeaver Support for the Tomcat server. -->
    <Loader
        loaderClass="org.springframework.instrument.classloading.tomcat.TomcatInstrumentableClassLoader"
        useSystemClassLoaderAsParent="false" />

    <Resource auth="Container"
        factory="com.atomikos.tomcat.EnhancedTomcatAtomikosBeanFactory"
        maxPoolSize="10"
        name="jdbc/ssa_guest"
        type="com.atomikos.jdbc.AtomikosDataSourceBean"
        uniqueResourceName="dataSourceConnect"
        xaDataSourceClassName="oracle.jdbc.xa.client.OracleXADataSource"
        xaProperties.URL="jdbc:oracle:thin:@ssad01.target.com:1522/SSAGFD01"
        xaProperties.databaseName="SSAD01"
        xaProperties.user="SSAGFUSR_DEMO1"
        xaProperties.password="ssausr23$0"/>

     <Resource auth="Container"
        factory="com.atomikos.tomcat.EnhancedTomcatAtomikosBeanFactory"
        maxPoolSize="10"
        minPoolSize="1"
        name="jms/SSAJMSQueueConnectionFactory"
        type="com.atomikos.jms.AtomikosConnectionFactoryBean"
        uniqueResourceName="QCF_MQSeries_XA_RMI"
        xaConnectionFactoryClassName="com.ibm.mq.jms.MQXAQueueConnectionFactory"
        xaProperties.channel="SYSTEM.DEF.SVRCONN"
        xaProperties.hostName="localhost"
        xaProperties.port="1414"
        xaProperties.queueManager="SDBXBRK1"
        xaProperties.transportType="1"
         />
        
    d. Added all the required transaction jars. Also transaction properties:
    

2. Changes done in the code ,

a. transaction.xml :

    <bean id="UserTransactionBean"
        class="org.springframework.jndi.JndiObjectFactoryBean">
        <property name="jndiName" value="java:comp/UserTransaction"></property>
    </bean>
    
    <!--  One Bean that applies Transaction semantics as well as Retry Logic. It only supports
    PROPOGATION_REQUIRED SEMANTICS.
    -->
    <bean id="TstTransactionInterceptor"
        class="com.test.transaction.interceptor.TstTransactionInterceptor">
        
        <property name="exceptionHandler" ref="TstRuntimeExceptionHandler" />
        
        <!--  Max Times to Retry a Transaction eligible for Retry -->
        <property name="maxRetryAttempts" value="1" />
        
        <!--  Time to wait between retries of eligible transactions ( in seconds)
        -->
        <property name="waitTimeBetweenRetries" value="2"></property>
        <property name="userTransaction" ref="UserTransactionBean" />

        <!--  List of methods that transaction interceptor will not apply declarative transactions for
        -->
        <property name="excludedMethodList">
            <list>
                <value>toString</value>
                <value>equals</value>
            </list>
        </property>
    </bean>
    
    <bean id="JTATxManager"
        class="org.springframework.transaction.jta.JtaTransactionManager">
        <property name="autodetectTransactionManager" value="true" />
    </bean>
    
    <bean id="SpringTransactionInterceptor"
        class="org.springframework.transaction.interceptor.TransactionInterceptor">
        <property name="transactionManager">
            <ref bean="JTATxManager" />
        </property>
        <property name="transactionAttributeSource">
            <ref bean="TransactionAttributes" />
        </property>
    </bean>

ISSUE:
We always get No JTA TransactionManager found in the logs only when we try to push a message to the queue. We are able to do DB calls successfully:

    -- checkUserTransactionAndTransactionManager, No JTA TransactionManager found: transaction suspension not available

    -- WARNING: atomikos connection pool 'QCF_MQSeries_XA_RMI': error creating proxy of connection atomikos pooled connection for resource QCF_MQSeries_XA_RMI
        [3/28/14 14:26:25:052 CDT] 00000137 ConnectionPoo W com.atomikos.logging.JULLogger logWarning atomikos connection pool 'QCF_MQSeries_XA_RMI': error creating proxy of connection atomikos pooled connection for resource QCF_MQSeries_XA_RMI
                                com.atomikos.datasource.pool.CreateConnectionException: atomikos pooled connection for resource QCF_MQSeries_XA_RMI: connection is erroneous
                                
    --     WARN  logWarning, atomikos MessageConsumer proxy for com.ibm.mq.jms.MQQueueReceiver@73085060: The JMS session you are using requires a JTA transaction context for the calling thread and none was found.
        WARN  logWarning, Error in proxy
        com.atomikos.jms.AtomikosTransactionRequiredJMSException: The JMS session you are using requires a JTA transaction context for the calling thread and none was found.
        Please correct your code to do one of the following:
        1. start a JTA transaction if you want your JMS operations to be subject to JTA commit/rollback, or
        2. increase the maxPoolSize of the AtomikosConnectionFactoryBean to avoid transaction timeout while waiting for a connection, or
        3. create a non-transacted session and do session acknowledgment yourself, or
        4. set localTransactionMode to true so connection-level commit/rollback are enabled.
            at com.atomikos.jms.AtomikosTransactionRequiredJMSException.throwAtomikosTransactionRequiredJMSException(AtomikosTransactionRequiredJMSException.java:40)

If anybody has faced this issue , please let us know how you solved it.
sk Send private email
Friday, March 28, 2014
 
 
Hi,

Sorry for the late reply. We're not sure what is causing this problem but we can find out if you could consider purchasing support :-)

Best
Guy Pardon Send private email
Saturday, July 05, 2014
 
 

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

Other recent topics Other recent topics