为什么 bitronix (BTM) 不将用户事务绑定到 JNDI 中?

发布于 2024-07-19 01:15:14 字数 452 浏览 2 评论 0原文

看起来 Bitronix 正如其他地方所建议的那样,工作得很好。 然而,我被它的一个问题难住了。 当我尝试保存会话之后时,我从 Hibernate 中调用 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)

我看不到任何 Bitronix 绑定用户事务的证据到 JNDI。 我怎样才能让它做到这一点?

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

哭了丶谁疼 2024-07-26 01:15:14

此处回答: https ://github.com/bitronix/btm/blob/master/btm-docs/src/main/asciidoc/Hibernate2x.adoc#txManager

简而言之,BTM没有办法自动将自己绑定到Tomcat的JNDI 服务器,除非您自己更改 Tomcat 配置。 此处对此进行了解释: https:/ /github.com/bitronix/btm/blob/master/btm-docs/src/main/asciidoc/TomcatWithBtm2x.adoc

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文