This discussion is archived
1 Reply Latest reply: Jun 5, 2013 6:42 AM by 888359 RSS

Get JTA from Spring on OAS/OC4J 10.1.3

888359 Newbie
Currently Being Moderated
I've a web app that needs to use JTA because there is 2 datasources. Each datasource is configured in the OC4j and are available through JNDI (each datasource is attached to a connection pool and is configured with the option: locals and globals transactions)

I'm not able to deploy the app because it seems there is no transaction manager available. I've tried different way to get the transaction manager, without success.

1. With the default Spring configuration:

<tx:jta-transaction-manager />
<tx:annotation-driven />

I've the following error at deployment:
Operation failed with error: Error creating bean with name 'transactionManager': Invocation of init method failed; nested exception is java.lang.IllegalStateException: No JTA UserTransaction available - specify either 'userTransaction' or 'userTransactionName' or 'transactionManager' or 'transactionManagerName'

2. With the OC4J special tx mgr:

<bean id="transactionManager" class="org.springframework.transaction.jta.OC4JJtaTransactionManager"></bean>
<tx:annotation-driven />

I've the same issue

3. By specifying the common jndi name

<bean id="transactionManager" class="org.springframework.transaction.jta.OC4JJtaTransactionManager">
<property name="transactionManagerName" value="java:comp/UserTransaction"/>
</bean>

The deployment error is the following

+Operation failed with error: Error creating bean with name 'transactionManager' defined in class path resource [eu/europa/curia/ws/refpub/config/applicationContext-transaction.xml]: Invocation of init method failed; nested exception is org.springframework.transaction.TransactionSystemException: JTA TransactionManager is not available at JNDI location [java:comp/UserTransaction]; nested exception is org.springframework.jndi.TypeMismatchNamingException: Object of type [class com.evermind.server.ApplicationServerTransactionManager] available at JNDI location [java:comp/UserTransaction] is not assignable to [javax.transaction.TransactionManager]+

4. Same with

<bean id="transactionManager" class="org.springframework.transaction.jta.OC4JJtaTransactionManager">
<property name="transactionManagerName" value="java:comp/pm/TransactionManager"/>
</bean>

+Operation failed with error: Error creating bean with name 'transactionManager' defined in class path resource [eu/europa/curia/ws/refpub/config/applicationContext-transaction.xml]: Invocation of init method failed; nested exception is org.springframework.transaction.TransactionSystemException: JTA TransactionManager is not available at JNDI location [java:comp/pm/TransactionManager]; nested exception is org.springframework.jndi.TypeMismatchNamingException: Object of type [class com.evermind.server.ApplicationServerTransactionManager] available at JNDI location [java:comp/pm/TransactionManager] is not assignable to [javax.transaction.TransactionManager]+

What is the JNDI name of the transaction Manager on OC4J 10.1.3?
Is there any special configuration to do on the server (or in the application descriptor) to enable it?

For your information, I think this issue is specific to OC4J because I managed to do it with other app server.
  • 1. Re: Get JTA from Spring on OAS/OC4J 10.1.3
    888359 Newbie
    Currently Being Moderated
    It seems the issues comes from the classloader. I've set the option search-local-classes-first to "false"
    and it deploys now with the spring configuration:

    <pre>
    <bean id="transactionManager" class="org.springframework.transaction.jta.OC4JJtaTransactionManager"></bean>
    <tx:annotation-driven />
    </pre>

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points