【发布时间】:2014-01-14 15:25:04
【问题描述】:
目前我正在使用 Weblogic 12.1.2 DEV 版本进行 EJB 开发。我需要调用一个远程 EJB(另一个 Weblogic 服务器)。所以我配置了一个指向这个远程 EJB 的 Foreign 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 事务不能再提交。知道如何解决这个问题吗?
【问题讨论】:
标签: transactions ejb weblogic xa