Atomikos Forum

Spring Batch combined with Atomikos not working

I’m having trouble configuring an Tomcat – Spring Batch – Atomikos combination. I have configured the following (I’m not mentioning the JMS configuration)
- Atomikos DataSource (proxy) based on
com.atomikos.tomcat.EnhancedTomcatAtomikosBeanFactory for Oracle XA datasource.
- JtaTransactionManager based on
  > transactionManager based on com.atomikos.icatch.jta.J2eeTransactionManager
  > userTransaction based on com.atomikos.icatch.jta.J2eeUserTransaction

When executing a batch job I receive the following error:
Caused by: java.lang.RuntimeException: Transaction Service Not Running?
    at com.atomikos.icatch.jta.J2eeUserTransaction.checkSetup(J2eeUserTransaction.java:70)
    at com.atomikos.icatch.jta.J2eeUserTransaction.getStatus(J2eeUserTransaction.java:125)
    at org.springframework.transaction.jta.JtaTransactionManager.
        isExistingTransaction(JtaTransactionManager.java:797)

Debugging revealed  the following:
===================================
Spring Batch makes use of TaskletStep. This class uses a PlatformTransactionManager that is instantiated with a DataSourceTransactionManager? The datasource is referring to a AtomikosDataSourceBean, that seems ok.

I have several questions:
- Where is this DataSourceTransactionManager coming from?
I have defined a JtaTransactionManager!
/ I thought the AtomikosDataSourceBean acts like a proxy to connect to JtaTransactionManager. Why is Atomikos given the error “Transaction Service Not Running?”
Eric Bosten Send private email
Tuesday, March 29, 2016
 
 
I'm pretty new to this, but I think just creating a JtaTransactionManager isn't enough.  Does it use Atomikos-implemented UserTransactionManager and UserTransactionImp?

I'm seeing the same error on Spring startup as some beans come to life, possibly ahead of the transaction managers.  By the time the system is done starting everything seems to work (for a little while, see my own post for my Oracle out-of-cursors errors).
Bill Milligan Send private email
Sunday, May 15, 2016
 
 
When integrating with Spring it is important to configure the right startup ordering for all the beans involved.

The only really sure way to get automatic configuration for Spring / Tomcat platforms is to use ExtremeTransactions - it has built-in support that makes it almost impossible to make mistakes.
Guy Pardon Send private email
Monday, May 16, 2016
 
 

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

Other recent topics Other recent topics