问题描述
我正在使用Java 1.6.0_23和Glassfish 3.1.1。我有两个Singleton EJB。一种是使用TimerService触发@Timeout函数。在@Timeout期间,另一个Singleton EJB中调用了@Asynchronous函数。它在95%的时间内正常工作,没有任何错误。但是在调用@Asynchronous函数的另外5%的时间内,我收到以下错误,但没有证据表明它甚至启动了@Asynchronous函数。没有记录其他错误详细信息。
I am using Java 1.6.0_23 and Glassfish 3.1.1. I have two Singleton EJBs. One is using the TimerService to fire the @Timeout function. During the @Timeout, an @Asynchronous function in called in the other Singleton EJB. It works 95% of the time without any errors. But the other 5% of the time when the @Asynchronous function is called, I get the following error with no evidence that it even started the @Asynchronous function. No other error details are logged.
有什么想法吗?
PS:我尝试将Glassfish中的EJB的最大数量从32个增加到64个。没有变化。
PS: I tried increasing the max number of EJBs in Glassfish from 32 to 64. No change.
java.util.concurrent.ExecutionException: javax.ejb.EJBTransactionRolledbackException
at com.sun.ejb.containers.EjbAsyncTask.call(EjbAsyncTask.java:132) ~[ejb-container.jar:3.1.1]
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) ~[na:1.6.0_23]
at java.util.concurrent.FutureTask.run(FutureTask.java:138) ~[na:1.6.0_23]
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) ~[na:1.6.0_23]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) ~[na:1.6.0_23]
at java.lang.Thread.run(Thread.java:662) ~[na:1.6.0_23]
Caused by: javax.ejb.EJBTransactionRolledbackException: null
at com.sun.ejb.containers.BaseContainer.mapLocal3xException(BaseContainer.java:2305) ~[ejb-container.jar:3.1.1]
at com.sun.ejb.containers.BaseContainer.postInvoke(BaseContainer.java:2088) ~[ejb-container.jar:3.1.1]
at com.sun.ejb.containers.EjbAsyncTask.call(EjbAsyncTask.java:114) ~[ejb-container.jar:3.1.1]
... 5 common frames omitted
Caused by: javax.ejb.TransactionRolledbackLocalException: Client's transaction aborted
at com.sun.ejb.containers.BaseContainer.useClientTx(BaseContainer.java:4699) ~[ejb-container.jar:3.1.1]
at com.sun.ejb.containers.BaseContainer.preInvokeTx(BaseContainer.java:4577) ~[ejb-container.jar:3.1.1]
at com.sun.ejb.containers.BaseContainer.preInvoke(BaseContainer.java:1910) ~[ejb-container.jar:3.1.1]
at com.sun.ejb.containers.EjbAsyncTask.call(EjbAsyncTask.java:99) ~[ejb-container.jar:3.1.1]
... 5 common frames omitted
推荐答案
我也遇到了。
似乎问题不是编码问题,而是服务器资源。
Happened to me as well.Seems the problem is not a coding problem, but server resources.
我增加了http线程池的大小
对我来说最大为5我将其更改为10
I increased the http thread pool sizeIt was 5 max for me and I changed it to 10
似乎可以解决该问题。
有关此错误的一些注意事项在这里:
Also some notes on this error here:http://pcjuzeren.blogspot.co.il/2008/12/clients-transaction-aborted.html
这篇关于EJBTransactionRolledbackException偶尔会在@Asynchronous函数上发生的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!