Spring JTA configuration - how to set TransactionManager?

不问归期 提交于 2019-11-29 23:17:48

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.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!