Question

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?

Was it helpful?

Solution

This is answered here: https://github.com/bitronix/btm/blob/master/btm-docs/src/main/asciidoc/Hibernate2x.adoc#txManager

In a nutshell, there is no way for BTM to automatically bind itself to Tomcat's JNDI server unless you change the Tomcat config yourself. This is explained here: https://github.com/bitronix/btm/blob/master/btm-docs/src/main/asciidoc/TomcatWithBtm2x.adoc

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top