Spring JTA configuration - how to set TransactionManager? Spring JTA configuration - how to set TransactionManager? spring spring

Spring JTA configuration - how to set TransactionManager?


Yes, that's alright. The stack trace you were seeing was also alright: <tx:jta-transaction-manager/> tries to acquire the transaction manager from a number of different standard locations; for every failed JNDI lookup, you'll see the javax.naming.NameNotFoundException.

java:/TransactionManager is where JBoss binds to by default; other servlet containers will default to java:/comp/TransactionManager, which I think is supposed to be the "standard" location for the TM.

From the Spring reference documentation:

For standard scenarios, including WebLogic, WebSphere and OC4J, consider using the convenient <tx:jta-transaction-manager/> configuration element. This will automatically detect the underlying server and choose the best transaction manager available for the platform. This means that you won't have to configure server-specific adapter classes (as discussed in the following sections) explicitly; they will rather be chosen automatically, with the standard JtaTransactionManager as default fallback.


A common "mistake" is to bundle things like jta.jar and/or jbossall-client.jar in the J2EE component you deploy. Double check please and remove them if this is the case.