2012-09-26 38 views
1

我們正在嘗試向代理隊列寫入消息。但是當整個請求嘗試提交JMS事務&時,它會嘗試回滾每個後續時間。我們使用oracle XA驅動程序。不確定發佈此問題的位置:MQ論壇或Oracle論壇。所以認爲會在這裏嘗試。有人可以幫助解決這個請。嘗試提交jms事務時xa_commit失敗

錯誤:

[9/25/12 17:10:06:871 EDT] 0000003e XATransaction E J2CA0027E: An exception occurred while invoking commit on an XA Resource Adapter from dataSource [email protected], within transaction ID {XidImpl: formatId(57415344), gtrid_length(36), bqual_length(54), data(00000139ff43ef2500000001000043106c82332ef6bc723402e84f341fb357080ddd4d1b00000139ff43ef2500000001000043106c82332ef6bc723402e84f341fb357080ddd4d1b000000010000000000000000000000000001)}: javax.transaction.xa.XAException: The method 'xa_commit' has failed with errorCode '-7'. 
    at com.ibm.mq.jmqi.JmqiXAResource.commit(JmqiXAResource.java:407) 
    at com.ibm.ejs.jms.JMSManagedSession$JMSXAResource.commit(JMSManagedSession.java:1702) 
    at com.ibm.ejs.j2c.XATransactionWrapper.commit(XATransactionWrapper.java:463) 
    at com.ibm.ws.Transaction.JTA.JTAXAResourceImpl.commit_one_phase(JTAXAResourceImpl.java:305) 
    at com.ibm.ws.Transaction.JTA.RegisteredResources.flowCommitOnePhase(RegisteredResources.java:2916) 
    at com.ibm.ws.Transaction.JTA.TransactionImpl.commitXAResources(TransactionImpl.java:2533) 
    at com.ibm.ws.Transaction.JTA.TransactionImpl.stage1CommitProcessing(TransactionImpl.java:1687) 
    at com.ibm.ws.Transaction.JTA.TransactionImpl.processCommit(TransactionImpl.java:1647) 
    at com.ibm.ws.Transaction.JTA.TransactionImpl.commit(TransactionImpl.java:1582) 
    at com.ibm.ws.Transaction.JTA.TranManagerImpl.commit(TranManagerImpl.java:247) 
    at com.ibm.ws.Transaction.JTA.TranManagerSet.commit(TranManagerSet.java:168) 
    at com.ibm.ws.Transaction.JTA.UserTransactionImpl.commit(UserTransactionImpl.java:293) 
    at org.springframework.transaction.jta.JtaTransactionManager.doCommit(JtaTransactionManager.java:1009) 
    at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:754) 
    at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:723) 
    at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.receiveAndExecute(AbstractPollingMessageListenerContainer.java:255) 
    at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.invokeListener(DefaultMessageListenerContainer.java:1002) 
    at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:901) 
    at org.springframework.scheduling.commonj.DelegatingWork.run(DelegatingWork.java:61) 
    at com.ibm.ws.asynchbeans.J2EEContext$RunProxy.run(J2EEContext.java:264) 
    at java.security.AccessController.doPrivileged(Native Method) 
    at com.ibm.ws.asynchbeans.J2EEContext.run(J2EEContext.java:1137) 
    at com.ibm.ws.asynchbeans.WorkWithExecutionContextImpl.go(WorkWithExecutionContextImpl.java:195) 
    at com.ibm.ws.asynchbeans.CJWorkItemImpl.run(CJWorkItemImpl.java:187) 
    at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1560) 
. 
[9/25/12 17:10:06:880 EDT] 0000003e RegisteredRes W WTRN0052E: An attempt by the transaction manager to call one phase commit on a transactional resource has resulted in an XAER_RMFAIL error. The resource was [email protected]#{XidImpl: formatId(57415344), gtrid_length(36), bqual_length(54), data(00000139ff43ef2500000001000043106c82332ef6bc723402e84f341fb357080ddd4d1b00000139ff43ef2500000001000043106c82332ef6bc723402e84f341fb357080ddd4d1b000000010000000000000000000000000001)} 
[9/25/12 17:10:06:887 EDT] 0000003e DefaultMessag W org.springframework.jms.listener.DefaultMessageListenerContainer handleListenerSetupFailure Setup of JMS message listener invoker failed for destination 'queue:///RANDOM QUEUE?targetClient=1' - trying to recover. Cause: Heuristic completion: outcome state is mixed; nested exception is javax.transaction.HeuristicMixedException 
+0

答案取決於應用程序服務器上使用,在耍什麼事務協調的作用,以及是否安裝了XA客戶端。請注意,該錯誤表示在事務資源上調用了單階段提交。這表明BEGIN動詞沒有被調用。 –

+0

感謝羅布。應用服務器是Websphere 6.0(或6.1),我想你問的是事務管理器。它是WebSphereUowTransactionManager。還應該在哪裏安裝XA客戶端?我不明白BEGIN謂詞沒有被調用。你能解釋一下嗎? – Harry

+0

對不起,哈里什我可能導致你有點誤入歧途。如果使用WebSphere App Server,則它本身可以使用MQ執行XA事務。另外,在JMS中沒有明確的BEGIN動詞。但是,在事務資源上調用單階段提交必定有一些原因。根據新的信息,瘋狂的猜測是跨線程會話的重用,其中一個是XA,另一個不是。但我希望有人會提出一個明確的答案,因爲我只是猜測在這一點上。請務必在發現解決方案時發佈解決方案。 –

回答

0

此前我們有多個JMS會話。這可能是其中一個環境中問題的原因。所以我們不得不改變2差異。會議&現在它的作品!

朱利安:

我的情況與你的情況稍有不同。早些時候,我們有:

請求消息放在隊列中。這個隊列被拾起&處理。然後我們保存到DB &然後生成另一個消息&把它放在另一個經紀隊列&然後發送一個響應到第一個消息。所有這一切都是1流。

現在我們將其更改爲2個差異。流程:請求 - >處理 - >保存到數據庫 - >回覆 然後另一個流程放在Broker隊列中。

希望這有助於

1

Here的原因和解決

- 經濟通

The cause of these errors is usually the result of a WebSphere MQ messaging provider JMS Connection being closed off by WebSphere Application Server because the Aged timeout for the Connection has expired.

分辨率 -

To resolve this issue, ensure that the JMS Connection Factory being used by the application has the Connection Pool property Aged timeout set to zero. This will prevent JMS Connections being closed when they are returned to the Free Pool, and so ensures that any outstanding transactional work can be completed

有時還會引起d由有故障的DataDirect驅動程序進行報告並由IBM進行報告和修復,請參閱this

+0

我們之前檢查過。它已經設置爲零:(非常感謝您的回覆。非常感謝,但在這種情況下不起作用。再次感謝 – Harry

+0

我發現''XA_COMMIT''和調用以及DataDirect驅動程序有問題WS消息代理本身。您使用的是什麼版本的消息代理?我會用另一個可能的鏈接更新答案。看一看。 – Annjawn

+0

謝謝@Annjawn。我們沒有進入經紀人的渠道,但我們瞭解了細節。代理版本是6.1和修訂包4. – Harry