异常EJB已经与不完整的事务关联 [英] exception EJB is already associated with an incomplete transaction

查看:127
本文介绍了异常EJB已经与不完整的事务关联的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我调用列表页面时,我得到了这个错误,程序也正在运行,但是在工作和重定向调试页面上却有些进展,我无法修复它,任何人都知道这个错误,这是什么意思

信息:EJB5018:在[EjbSynchronizations]
信息的ejb调用期间引发了异常:javax.ejb.EJBException:嵌套异常是:java.lang.IllegalStateException: EJB已经与不完整的事务
相关联java.lang.IllegalStateException:EJB已经与不完整的事务
相关联com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:98)
// 大量无用的错误信息

INFO: EJB5018: An exception was thrown during an ejb invocation on [EjbSynchronizations] INFO: javax.ejb.EJBException: nested exception is: java.lang.IllegalStateException: EJB is already associated with an incomplete transaction java.lang.IllegalStateException: EJB is already associated with an incomplete transaction com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:98) //lots of useless error info

推荐答案

该错误表示两个线程正在尝试执行以下操作:调用相同的有状态会话Bean实例。有状态会话Bean实例一次只能与单个事务(每个线程)关联。没有更多信息,就不可能知道应用程序出了什么问题来实现这一目标。一种可能性是应用程序将有状态会话Bean注入到servlet中,因此所有线程上的所有请求都试图使用同一实例。每个请求都应该创建自己的bean实例,或者bean实际上应该是无状态的。

The error means that two threads are attempting to call the same stateful session bean instance. A stateful session bean instance can only be associated with a single transaction (which are per thread) at a time. Without more information, it's impossible to know what is wrong with the application to make this happen. One possibility is that the application injects a stateful session bean into a servlet, so all requests on all threads are attempting to use the same instance. Either each request should create its own instance of the bean, or the bean should actually be stateless.

这篇关于异常EJB已经与不完整的事务关联的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆