We have a CMP stateless session bean which has transaction commit problem.
The internal sequence of our API is like follows:
1. queried Oracle data via DAO
2. called third party session bean API to set information
3. return the result to client
Environment Brief:
Oracle is 8.1.7
WebLogic is 6.1 sp3
Run on Sun OS 5.8
Third party beans using same WebLogic server but has its security reamls.
The normal response time of our API is within 5 sec. The timeout time is about 120 sec.
From the logs, step 1 and 2 were done fine and ready to return the result. Client can get its result normally when
test on customer�s testing environment or if remove the transaction control. Nevertheless, it finished whole works but throws TimeoutException at one of our customers production servers randomly without any other errors. We checked all 3 servers� configuration. They are similar or same. The only different is IP and port numbers.
We moved the AP server to WebLogic 8.1sp1 for test. The TimeoutException happen every time.
We think it could be the result of principle and credential change when calling the third party API. It causes the container cannot commit the original DB during this transaction.
What can we do to solve the random error if we still need to use CMP to handle the transactions?
the following is the log
<May 11, 2004 7:29:37 PM CST> <Error> <
EJB> <Exception during commit of transaction Name=[EJB com.fet.np.newcash.mileage.redemption.ejb.RedemptionBean.retvRedeemInfoList(com.fet.np.common.vo.UserVo,com.fet.np.newcash.mileage.common.vo.MilInfoIdVo)],Xid=29:c72fa81cdbd3dd0b(4741190),Status=Rolling Back. [Reason=weblogic.transaction.internal.TimedOutException: Transaction timed out after 123 seconds
Name=[EJB com.fet.np.newcash.mileage.redemption.ejb.RedemptionBean.retvRedeemInfoList(com.fet.np.common.vo.UserVo,com.fet.np.newcash.mileage.common.vo.MilInfoIdVo)],Xid=29:c72fa81cdbd3dd0b(4741190),Status=Active (PrePreparing),numRepliesOwedMe=0,numRepliesOwedOthers=0,seconds since begin=123,seconds left=60,activeThread=Thread[ExecuteThread: '7' for queue: 'default',5,
Thread Group for Queue: 'default'],ServerResourceInfo[weblogic.jdbc.jts.Connection]=(state=ended,assigned=none),SCInfo[MigPRD+MigPRD_NodeB]=(state=pre-prepared),SCInfo[acm416+acm416Server]=(state=pre-preparing),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPR D+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=acti ve),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_No deB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),properties=({weblogic.transaction.name=[EJB com.fet.np.newcash.mileage.redemption.ejb.RedemptionBean.retvRedeemInfoList(com.fet.np.common.vo.UserVo,com.fet.np.newcash.mileage.common.vo.MilInfoIdVo)], weblogic.jdbc=t3://10.64.35.63:10203}),OwnerTransactionManager=ServerTM[ServerCoordinatorDescriptor=(CoordinatorURL=MigPRD_NodeB+10.64.35.63:10203+MigPRD+, Resources={})],CoordinatorURL=MigPRD_NodeB+10.64.35.63:10203+MigPRD+)],numRepliesOwedMe=0,numRepliesOwedOthers=0,seconds since begin=243,seconds left=10,ServerResourceInfo[weblogic.jdbc.jts.Connection]=(state=rolledback,assigned=MigPRD_NodeB),SCInfo[MigPRD+MigPRD_NodeB]=(state=rolledback),SCInfo[acm416+acm416Server]=(state=rolling-back),SCInfo[MigPRD+MigPRD_NodeB]=(state=rolledback),SCInfo[MigPRD+MigPRD_NodeB]=(state=rolledback),SCInfo[MigPRD+MigPRD_NodeB]=(state=rolledback),SCInfo[MigPRD+MigPRD_NodeB]=(state=rolledback),SCInfo[MigPRD+MigPRD_NodeB]=(state=rolledback),SCInfo[MigPRD+MigPRD_NodeB]=(state=rolledback),SCInfo[MigPRD+MigPRD_Nod eB]=(state=rolledback),SCInfo[MigPRD+MigPRD_NodeB]=(state=rolledback),SCInfo[MigPRD+MigPRD_NodeB]=(state=rolledback),SCInfo[MigPRD+MigPRD_NodeB]=(state=rolledback),SCInfo[MigPRD+MigPRD_NodeB]=(state=rolledback),SCInfo[MigPRD+MigPRD_NodeB]=(state=rolledback),SCInfo[MigPRD+MigPRD_NodeB]=(state=rolledback),SCInfo[MigPRD+MigPRD_NodeB]=(state=rolledback),SCInfo[MigPRD+MigPRD_NodeB]=(state=rolledback),SCInfo[MigPRD+MigPRD_NodeB]=(state=rolledback),SCInfo[MigPRD+MigPRD_NodeB]=(state=rolledback),SCInfo[ MigPRD+MigPRD_NodeB]=(state=rolledback),SCInfo[MigPRD+MigPRD_NodeB]=(state=rolledback),SCInfo[MigPRD+MigPRD_NodeB]=(state=rolledback),SCInfo[MigPRD+MigPRD_NodeB]=(state=rolledback),SCInfo[MigPRD+MigPRD_NodeB]=(state=rolledback),SCInfo[MigPRD+MigPRD_NodeB]=(state=rolledback),SCInfo[MigPRD+MigPRD_NodeB]=(state=rolledback),SCInfo[MigPRD+MigPRD_NodeB]=(state=rolledback),SCInfo[MigPRD+MigPRD_NodeB]=(state=rolledback),SCInfo[MigPRD+MigPRD_NodeB]=(state=rolledback),SCInfo[MigPRD+MigPRD_NodeB]=(state=ro lledback),SCInfo[MigPRD+MigPRD_NodeB]=(state=rolledback),SCInfo[MigPRD+MigPRD_NodeB]=(state=rolledback),SCInfo[MigPRD+MigPRD_NodeB]=(state=rolledback),SCInfo[MigPRD+MigPRD_NodeB]=(state=rolledback),SCInfo[MigPRD+MigPRD_NodeB]=(state=rolledback),properties=({weblogic.transaction.name=[EJB com.fet.np.newcash.mileage.redemption.ejb.RedemptionBean.retvRedeemInfoList(com.fet.np.common.vo.UserVo,com.fet.np.newcash.mileage.common.vo.MilInfoIdVo)], weblogic.jdbc=t3://10.64.35.63:10203}),OwnerTransactionManager=ServerTM[ServerCoordinatorDescriptor=(CoordinatorURL=MigPRD_NodeB+10.64.35.63:10203+MigPRD+, Resources={})],CoordinatorURL=MigPRD_NodeB+10.64.35.63:10203+MigPRD+): weblogic.transaction.internal.TimedOutException: Transaction timed out after 123 seconds
Name=[EJB com.fet.np.newcash.mileage.redemption.ejb.RedemptionBean.retvRedeemInfoList(com.fet.np.common.vo.UserVo,com.fet.np.newcash.mileage.common.vo.MilInfoIdVo)],Xid=29:c72fa81cdbd3dd0b(4741190),Status=Active (PrePreparing),numRepliesOwedMe=0,numRepliesOwedOthers=0,seconds since begin=123,seconds left=60,activeThread=Thread[ExecuteThread: '7' for queue: 'default',5,Thread Group for Queue: 'default'],ServerResourceInfo[weblogic.jdbc.jts.Connection]=(state=ended,assigned=none),SCInfo[MigPRD+MigPRD_NodeB]=(state=pre-prepared),SCInfo[acm416+acm416Server]=(state=pre-preparing),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPR D+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=acti ve),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_No deB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),properties=({weblogic.transaction.name=[EJB com.fet.np.newcash.mileage.redemption.ejb.RedemptionBean.retvRedeemInfoList(com.fet.np.common.vo.UserVo,com.fet.np.newcash.mileage.common.vo.MilInfoIdVo)], weblogic.jdbc=t3://10.64.35.63:10203}),OwnerTransactionManager=ServerTM[ServerCoordinatorDescriptor=(CoordinatorURL=MigPRD_NodeB+10.64.35.63:10203+MigPRD+, Resources={})],CoordinatorURL=MigPRD_NodeB+10.64.35.63:10203+MigPRD+)
at weblogic.transaction.internal.ServerTransactionImpl.wakeUp(ServerTransactionImpl.java:1121)
at weblogic.transaction.internal.ServerTransactionManagerImpl.processTimedOutTransactions(ServerTransactionManagerImpl.java:466)
at weblogic.transaction.internal.TransactionManagerImpl.wakeUp(TransactionManagerImpl.java:1604)
at weblogic.transaction.internal.ServerTransactionManagerImpl.wakeUp(ServerTransactionManagerImpl.java:429)
at weblogic.transaction.internal.TransactionManagerImpl$1.run(TransactionManagerImpl.java:1570)
at java.lang.Thread.run(Thread.java:479)
--------------- nested within: ------------------
weblogic.transaction.RollbackException: Transaction timed out after 123 seconds
Name=[EJB com.fet.np.newcash.mileage.redemption.ejb.RedemptionBean.retvRedeemInfoList(com.fet.np.common.vo.UserVo,com.fet.np.newcash.mileage.common.vo.MilInfoIdVo)],Xid=29:c72fa81cdbd3dd0b(4741190),Status=Active (PrePreparing),numRepliesOwedMe=0,numRepliesOwedOthers=0,seconds since begin=123,seconds left=60,activeThread=Thread[ExecuteThread: '7' for queue: 'default',5,Thread Group for Queue: 'default'],ServerResourceInfo[weblogic.jdbc.jts.Connection]=(state=ended,assigned=none),SCInfo[MigPRD+MigPRD_NodeB]=(state=pre-prepared),SCInfo[acm416+acm416Server]=(state=pre-preparing),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPR D+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=acti ve),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_No deB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),properties=({weblogic.transaction.name=[EJB com.fet.np.newcash.mileage.redemption.ejb.RedemptionBean.retvRedeemInfoList(com.fet.np.common.vo.UserVo,com.fet.np.newcash.mileage.common.vo.MilInfoIdVo)], weblogic.jdbc=t3://10.64.35.63:10203}),OwnerTransactionManager=ServerTM[ServerCoordinatorDescriptor=(CoordinatorURL=MigPRD_NodeB+10.64.35.63:10203+MigPRD+, Resources={})],CoordinatorURL=MigPRD_NodeB+10.64.35.63:10203+MigPRD+) - with nested exception:
[weblogic.transaction.internal.TimedOutException: Transaction timed out after 123 seconds
Name=[EJB com.fet.np.newcash.mileage.redemption.ejb.RedemptionBean.retvRedeemInfoList(com.fet.np.common.vo.UserVo,com.fet.np.newcash.mileage.common.vo.MilInfoIdVo)],Xid=29:c72fa81cdbd3dd0b(4741190),Status=Active (PrePreparing),numRepliesOwedMe=0,numRepliesOwedOthers=0,seconds since begin=123,seconds left=60,activeThread=Thread[ExecuteThread: '7' for queue: 'default',5,Thread Group for Queue: 'default'],ServerResourceInfo[weblogic.jdbc.jts.Connection]=(state=ended,assigned=none),SCInfo[MigPRD+MigPRD_NodeB]=(state=pre-prepared),SCInfo[acm416+acm416Server]=(state=pre-preparing),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPR D+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=acti ve),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_No deB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),SCInfo[MigPRD+MigPRD_NodeB]=(state=active),properties=({weblogic.transaction.name=[EJB com.fet.np.newcash.mileage.redemption.ejb.RedemptionBean.retvRedeemInfoList(com.fet.np.common.vo.UserVo,com.fet.np.newcash.mileage.common.vo.MilInfoIdVo)], weblogic.jdbc=t3://10.64.35.63:10203}),OwnerTransactionManager=ServerTM[ServerCoordinatorDescriptor=(CoordinatorURL=MigPRD_NodeB+10.64.35.63:10203+MigPRD+, Resources={})],CoordinatorURL=MigPRD_NodeB+10.64.35.63:10203+MigPRD+)]
at weblogic.transaction.internal.TransactionImpl.throwRollbackException(TransactionImpl.java:1481)
at weblogic.transaction.internal.ServerTransactionImpl.internalCommit(ServerTransactionImpl.java:262)
at weblogic.transaction.internal.ServerTransactionImpl.commit(ServerTransactionImpl.java:189)
at weblogic.ejb20.internal.BaseEJBObject.postInvoke(BaseEJBObject.java:272)
at com.fet.np.newcash.mileage.redemption.ejb.RedemptionBean_9z1jv4_EOImpl.retvRedeemInfoList(RedemptionBean_9z1jv4_EOImpl.java:550)
at com.fet.np.newcash.mileage.redemption.ejb.RedemptionBean_9z1jv4_EOImpl_WLSkel.invoke(Unknown Source)
at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:305)
at weblogic.rmi.cluster.ReplicaAwareServerRef.invoke(ReplicaAwareServerRef.java:93)
at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:274)
at weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java:22)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
>
and If there is not solution to there above problem I would like to handle the transaction programmatically in client code, by obtaining UserTransaction in the session facade to handle the transaction for enterprise bean in client side instead of using BMP by writing transaction codes in enterprise bean for Weblogic8.1,
I tried to obtain the javax.transaction.Usertransaction using context.lookup but i can not get it by got an Security exception instead in the ctx.lookup code in the facade it said can't load java.lang package with Classloader, anyone know how to obtain the UserTransaction (JTA) object from Weblogic so I can handle transactions programmatically in the client side ?