目前我正在使用Weblogic 12.1.2 DEV版进行EJB开发。我需要调用一个远程EJB(另一个Weblogic服务器)。所以我配置了一个指向这个远程EJB的外部JNDI Provider。一切都很好,直到我的本地EJB bean尝试提交事务,我得到以下异常:
<Dec 27, 2013 10:23:51 AM CST> <Error> <EJB> <BEA-010026> <Exception occurred during commit of transaction Name=[EJB test.bean.HelloBean.hello()],Xid=BEA1-00022F80B0CCE5A4E067(808603218),Status=Rolled back. [Reason=javax.transaction.SystemException: Commit can be issued only when there are no requests awaiting responses. Currently there is one such request],numRepliesOwedMe=1,numRepliesOwedOthers=0,seconds since begin=21,seconds left=30,SCInfo[domain1+AdminServer]=(state=rolledback),properties=({weblogic.transaction.name=[EJB test.bean.HelloBean.hello()]}),OwnerTransactionManager=ServerTM[ServerCoordinatorDescriptor=(CoordinatorURL=AdminServer+10.136.0.15:7001+domain1+t3+, XAResources={dev/sqlserver_domain1, WSATGatewayRM_AdminServer_domain1, local/sqlserver_domain1},NonXAResources={})],CoordinatorURL=AdminServer+10.136.0.15:7001+domain1+t3+): weblogic.transaction.RollbackException: Commit can be issued only when there are no requests awaiting responses. Currently there is one such request
at weblogic.transaction.internal.TransactionImpl.throwRollbackException(TransactionImpl.java:1878)
at weblogic.transaction.internal.ServerTransactionImpl.internalCommit(ServerTransactionImpl.java:359)
at weblogic.transaction.internal.ServerTransactionImpl.commit(ServerTransactionImpl.java:250)
at weblogic.ejb.container.internal.BaseRemoteObject.postInvoke1(BaseRemoteObject.java:374)
at weblogic.ejb.container.internal.StatelessRemoteObject.postInvoke1(StatelessRemoteObject.java:20)
at weblogic.ejb.container.internal.BaseRemoteObject.__WL_postInvokeTxRetry(BaseRemoteObject.java:226)
at weblogic.ejb.container.internal.SessionRemoteMethodInvoker.invoke(SessionRemoteMethodInvoker.java:47)
at test.bean.HelloBean_gbyfgg_HelloImpl.hello(Unknown Source)
at test.bean.HelloBean_gbyfgg_HelloImpl_WLSkel.invoke(Unknown Source)
at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:693)
at weblogic.rmi.cluster.ClusterableServerRef.invoke(ClusterableServerRef.java:230)
at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:519)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:146)
at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:515)
at weblogic.rmi.internal.wls.WLSExecuteRequest.run(WLSExecuteRequest.java:118)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:295)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:254)
Caused by: javax.transaction.SystemException: Commit can be issued only when there are no requests awaiting responses. Currently there is one such request
at weblogic.transaction.internal.TransactionImpl.abort(TransactionImpl.java:1151)
at weblogic.transaction.internal.TransactionImpl.enforceCheckedTransaction(TransactionImpl.java:1809)
at weblogic.transaction.internal.TransactionImpl.checkIfCommitPossible(TransactionImpl.java:1787)
at weblogic.transaction.internal.ServerTransactionImpl.internalCommit(ServerTransactionImpl.java:275)
... 16 more
.>
在添加此远程EJB调用之前,应用程序使用weblogic提供的no-xa JDBC驱动程序调用两个sql server实例。但是,它们通过启用模拟两阶段提交来支持全局事务。提交或回滚时应用程序运行良好。将此远程EJB调用添加到进程后,XA事务不再提交。知道怎么解决这个问题吗?
答案 0 :(得分:1)
You have three options and your should decide which one is best depending on your non-functional requirements (e.g. security etc):
I have tried the latter and they both worked. You can find more details if you google the keywords from above - there is some rudimentary weblogic documentation on all of the cases above.
You might also want to enable the transactions logging using the console while you are trying to get it to work. It prints a lot of information, some of which might be useful.
答案 1 :(得分:0)
远程ejb调用是否成功完成或是否抛出异常/此远程ejb调用是代表同一事务执行的。