gpt4 book ai didi

java - javax.persistence.TransactionRequiredException 的可能原因

转载 作者:太空宇宙 更新时间:2023-11-04 15:06:26 28 4
gpt4 key购买 nike

TransactionRequiredException 的可能原因是什么?

javax.ejb.EJBTransactionRolledbackException: JBAS011469:
Transaction is required to perform this operation
(either use a transaction or extended persistence context)

我们有一个设置,可以通过 JNDI 接口(interface)从普通 JVM 向应用程序容器 (jboss 7) 运行测试。我们有一个夜间构建,每天晚上都会运行此代码,并且通常会成功。然而,有时,在执行一定时间后,所有测试都开始失败,并出现上述异常,而无需更改任何代码。任何外部问题都会导致这种情况吗?我们有磁盘空间,并且由于异常是通过网络传递的,我认为网络也很好。以下任一情况是否会导致这样的异常:

  • 缺少文件描述符
  • Hibernate 与数据库 (mysql) 通信时出现问题
  • CPU 负载
  • 内存不足

抱歉,如果问题有点抽象,但我无法理解这个问题。所有解决方案和调试建议都非常受欢迎。

最佳答案

我在 jboss 提供的 server.log 中找到了答案。日志显示,当测试开始失败时,此类:

org.hornetq.core.client

抛出

Throwable: java.lang.OutOfMemoryError: unable to create new native thread

因此可能会导致 OutOfMemoryError

javax.ejb.EJBTransactionRolledbackException: JBAS011469:
Transaction is required to perform this operation
(either use a transaction or extended persistence context)

关于java - javax.persistence.TransactionRequiredException 的可能原因,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21929258/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com