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 tomcat integration fails in Spring

Looks like Atomikos registers the TransactionManager under java:comp/env/TransationManager

but Spring looks for the transaction manager under java:comp/TransactionManager and fails.

context.xml in tomcat
---------------------
<Transaction factory="com.atomikos.icatch.jta.UserTransactionFactory" />
<Resource name="TransactionManager"
            auth="Container"            type="com.atomikos.icatch.jta.UserTransactionManager"
            factory="org.apache.naming.factory.BeanFactory" >
            
</Resource>

 <Loader loaderClass="org.springframework.instrument.classloading.tomcat.TomcatInstrumentableClassLoader"
          useSystemClassLoaderAsParent="false"/>

    <Resource name="jdbc/MyDataSource"
            auth="Container"
            type="com.atomikos.jdbc.AtomikosDataSourceBean"
            factory="com.atomikos.tomcat.EnhancedTomcatAtomikosBeanFactory"
            uniqueResourceName="MyDataSource_Resource"
            maxPoolSize="8"
            xaDataSourceClassName="org.apache.derby.jdbc.ClientXADataSource"
            xaProperties.databaseName="DB123"         
            xaProperties.connectionAttributes="serverName=localhost;portNumber=1433;user=sa;password=xxxxxx;create=true"/>

server.xml in Tomcat
--------------------
<Listener className="com.atomikos.tomcat.AtomikosLifecycleListener" />

spring-beans.xml
----------------
<tx:jta-transaction-manager />
<bean id="atomikosTransactionManager" class="com.atomikos.icatch.jta.UserTransactionManager"
    init-method="init" destroy-method="close" depends-on="userTransactionService">
    <property name="transactionTimeout" value="300" />
    <property name="startupTransactionService" value="false"/>
     <property name="forceShutdown" value="false" />
    </bean>
    
    <bean id="atomikosUserTransaction" class="com.atomikos.icatch.jta.UserTransactionImp"  depends-on="userTransactionService">
        <property name="transactionTimeout" value="300" />
    </bean>

    <bean id="transactionManager"
    class="org.springframework.transaction.jta.JtaTransactionManager" depends-on="userTransactionService">
    <property name="userTransaction" ref="atomikosUserTransaction" />
     <property name="transactionManager" ref="atomikosTransactionManager" />
    
     <property name="transactionManagerName" value="java:comp/env/TransactionManager"></property>
      <property name="autodetectUserTransaction" value="true"></property>
    </bean>

Can you please help?
Jiju Jacob Send private email
woensdag 14 juni 2017
 
 
Powered by FogBugz