Tomcat中可以使用JTA吗?

我的编程架构为Tomcat+Spring,其中要用到Spring的JTA事务管理机制,但启动的时候老是报错误:
ERROR Context initialization failed - org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:108)

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'transactionManager' defined in resource [/WEB-INF/applicationContext.xml] of ServletContext: Initialization of bean failed; nested exception is org.springframework.transaction.TransactionSystemException: JTA UserTransaction is not available at JNDI location [java:comp/UserTransaction]; nested exception is javax.naming.NamingException: Cannot create resource instance

org.springframework.transaction.TransactionSystemException: JTA UserTransaction is not available at JNDI location [java:comp/UserTransaction]; nested exception is javax.naming.NamingException: Cannot create resource instance

请问在Tomcat中能否使用JTA呢?如果可以的话,怎么配合Spring使用,谢谢

自己顶一下。

你需要能够支持xa协议的transaction manager,opensource的有jotm

我用的是postgresql数据库,但它的JDBC包里面没有XA的Diver,那postgresql可以使用xa吗?

postgresql用过不多,不太清楚。不过也是主流免费db,应该会找得到支持xa 的jdbc driver吧