Atomikos Forum |
|
I've seen this question asked a few other times, but I can't find a good answer overall. I've tried following the spring and hibernate integration docs, but still am stuck.
I have tomcat 7 with all the atomikos jars, jta 1.1, my XA driver jars, and a jta.properties file all in the lib folder. In my server.xml I have added: <Listener className="com.atomikos.tomcat.AtomikosLifecycleListener" /> plus JNDI resources for my XA resources wrapped in the EnhancedTomcatAtomikosBeanFactory (a IBM MQ queue connection factory and an Oracle data source) Then I have a simple maven war project with Java 7 where I have added spring 3.2 jars and other libraries (e.g. cxf) In my war's /META-INF/context.xml I have: <Transaction factory="com.atomikos.icatch.jta.UserTransactionFactory" /> In my spring config I create beans for my JNDI resources and then create the following 3 beans: <bean id="atomikosTransactionManager" class="com.atomikos.icatch.jta.UserTransactionManager" init-method="init" destroy-method="close"> <property name="forceShutdown" value="true"/> </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> I have a test web service that sends a message to the queue and saves a record to the database. This setup WORKS 100%. Then I add hibernate 4.2 jars and spring-orm 3.2 to my pom and the application fails to start with: IllegalStateException Cannot convert value of type [com.atomikos.icatch.jta.UserTransactionManager] to required type [javax.transaction.TransactionManager] for property 'transactionManager': no matching editors or conversion strategy found I've not changed anything else like defining a session factory in my spring config. Just added the dependency. I can run a maven package and no jta jars are being added to my WEB-INF/lib so I am still using the correct version in my tomcat/lib and there is definitely only one version of the jar there. Why does adding Hibernate to my classpath change the result of what really amounts to an eventual call to TransactionManager.Class.isAssignableFrom(UserTransactionManager)? Thanks John |