1

Looks like Bitronix, as suggested elsewhere, works very well. However, I'm stumped by a problem with it. I get this exception from Hibernate, when I attempt to save the session after I call TransactionManager.begin():

14:21:32,350 ERROR [JTATransaction] Could not find UserTransaction in JNDI
javax.naming.NameNotFoundException: Name UserTransaction is not bound in this Context
    at org.apache.naming.NamingContext.lookup(NamingContext.java:769)

I can't see any evidence that Bitronix binds the user transaction to JNDI. How do I make it do that?

4

1 回答 1

3

这是在这里回答:https ://github.com/bitronix/btm/blob/master/btm-docs/src/main/asciidoc/Hibernate2x.adoc#txManager

简而言之,除非您自己更改 Tomcat 配置,否则 BTM 无法自动将自身绑定到 Tomcat 的 JNDI 服务器。这在这里解释:https ://github.com/bitronix/btm/blob/master/btm-docs/src/main/asciidoc/TomcatWithBtm2x.adoc

于 2009-05-11T14:01:27.537 回答