获取 javax.transaction.HeuristicMixedException

发布于 2025-01-13 05:09:04 字数 5375 浏览 1 评论 0原文

我正在 IBM WebSphere 上运行 Spring Batch,并在应用程序日志中遇到以下异常:

UOWManager transaction processing failed; nested exception is com.ibm.wsspi.uow.UOWException: javax.transaction.HeuristicMixedException
    at org.springframework.transaction.jta.WebSphereUowTransactionManager.execute(WebSphereUowTransactionManager.java:313)
    at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:134)
    at org.springframework.batch.core.step.tasklet.TaskletStep$2.doInChunkContext(TaskletStep.java:273)
    at org.springframework.batch.core.scope.context.StepContextRepeatCallback.doInIteration(StepContextRepeatCallback.java:82)
    at org.springframework.batch.repeat.support.RepeatTemplate.getNextResult(RepeatTemplate.java:375)
    at org.springframework.batch.repeat.support.RepeatTemplate.executeInternal(RepeatTemplate.java:215)
    at org.springframework.batch.repeat.support.RepeatTemplate.iterate(RepeatTemplate.java:145)
    at org.springframework.batch.core.step.tasklet.TaskletStep.doExecute(TaskletStep.java:258)
    at org.springframework.batch.core.step.AbstractStep.execute(AbstractStep.java:208)
    at com.im.batch.integration.partition.IMTaskExecutorPartitionHandler$PartitionTaskCallable.call(IMTaskExecutorPartitionHandler.java:63)
    at com.im.batch.integration.partition.IMTaskExecutorPartitionHandler$PartitionTaskCallable.call(IMTaskExecutorPartitionHandler.java:46)
    at java.util.concurrent.FutureTask.run(FutureTask.java:277)
    at org.springframework.scheduling.commonj.DelegatingWork.run(DelegatingWork.java:63)
    at com.ibm.ws.asynchbeans.J2EEContext.run(J2EEContext.java:1178)
    at com.ibm.ws.asynchbeans.WorkWithExecutionContextImpl.go(WorkWithExecutionContextImpl.java:199)
    at com.ibm.ws.asynchbeans.CJWorkItemImpl.run(CJWorkItemImpl.java:236)
    at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1892)
Caused by: com.ibm.wsspi.uow.UOWException: javax.transaction.HeuristicMixedException
    at com.ibm.ws.uow.embeddable.EmbeddableUOWManagerImpl.runUnderNewUOW(EmbeddableUOWManagerImpl.java:823)
    at com.ibm.ws.uow.embeddable.EmbeddableUOWManagerImpl.runUnderUOW(EmbeddableUOWManagerImpl.java:370)
    at org.springframework.transaction.jta.WebSphereUowTransactionManager.execute(WebSphereUowTransactionManager.java:306)
    ... 16 more

在 sysout 日志中,我同时收到以下错误:

javax.transaction.xa.XAException: The method 'xa_commit' has failed with errorCode '-7' due to the resource being closed.
    at com.ibm.mq.jmqi.JmqiXAResource.commit(JmqiXAResource.java:460)
    at com.ibm.ejs.jms.JMSManagedSession$JMSXAResource.commit(JMSManagedSession.java:1444)
    at com.ibm.ejs.j2c.XATransactionWrapper.commit(XATransactionWrapper.java:496)
    at com.ibm.tx.jta.impl.JTAXAResourceImpl.commit(JTAXAResourceImpl.java:308)
    at com.ibm.tx.jta.impl.RegisteredResources.deliverOutcome(RegisteredResources.java:1644)
    at com.ibm.tx.jta.impl.RegisteredResources.distributeOutcome(RegisteredResources.java:2003)
    at com.ibm.tx.jta.impl.RegisteredResources.distributeCommit(RegisteredResources.java:2315)
    at com.ibm.tx.jta.impl.TransactionImpl.internalCommit(TransactionImpl.java:1911)
    at com.ibm.tx.jta.impl.TransactionImpl.internalCommit(TransactionImpl.java:1887)
    at com.ibm.tx.jta.impl.TransactionImpl.coreStage2CommitProcessing(TransactionImpl.java:1134)
    at com.ibm.tx.jta.impl.TransactionImpl.stage2CommitProcessing(TransactionImpl.java:1172)
    at com.ibm.tx.jta.impl.TransactionImpl.processCommit(TransactionImpl.java:1033)
    at com.ibm.tx.jta.impl.TransactionImpl.commit(TransactionImpl.java:963)
    at com.ibm.ws.tx.jta.TranManagerImpl.commit(TranManagerImpl.java:439)
    at com.ibm.tx.jta.impl.TranManagerSet.commit(TranManagerSet.java:191)
    at com.ibm.ws.uow.UOWManagerImpl.uowCommit(UOWManagerImpl.java:807)
    at com.ibm.ws.uow.embeddable.EmbeddableUOWManagerImpl.uowEnd(EmbeddableUOWManagerImpl.java:881)
    at com.ibm.ws.uow.UOWManagerImpl.uowEnd(UOWManagerImpl.java:782)
    at com.ibm.ws.uow.embeddable.EmbeddableUOWManagerImpl.runUnderNewUOW(EmbeddableUOWManagerImpl.java:818)
    at com.ibm.ws.uow.embeddable.EmbeddableUOWManagerImpl.runUnderUOW(EmbeddableUOWManagerImpl.java:370)
    at org.springframework.transaction.jta.WebSphereUowTransactionManager.execute(WebSphereUowTransactionManager.java:306)
    at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:134)
    at org.springframework.batch.core.step.tasklet.TaskletStep$2.doInChunkContext(TaskletStep.java:273)
    at org.springframework.batch.core.scope.context.StepContextRepeatCallback.doInIteration(StepContextRepeatCallback.java:82)
    at org.springframework.batch.repeat.support.RepeatTemplate.getNextResult(RepeatTemplate.java:375)
    at org.springframework.batch.repeat.support.RepeatTemplate.executeInternal(RepeatTemplate.java:215)
    at org.springframework.batch.repeat.support.RepeatTemplate.iterate(RepeatTemplate.java:145)
    at org.springframework.batch.core.step.tasklet.TaskletStep.doExecute(TaskletStep.java:258)
    at org.springframework.batch.core.step.AbstractStep.execute(AbstractStep.java:208)
    at com.im.batch.integration.partition.IMTaskExecutorPartitionHandler$PartitionTaskCallable.call(IMTaskExecutorPartitionHandler.java:63)

我已检查 websphere 上的 Aged Time out =0

I am running a Spring Batch on IBM WebSphere and encountered below exception in application log:

UOWManager transaction processing failed; nested exception is com.ibm.wsspi.uow.UOWException: javax.transaction.HeuristicMixedException
    at org.springframework.transaction.jta.WebSphereUowTransactionManager.execute(WebSphereUowTransactionManager.java:313)
    at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:134)
    at org.springframework.batch.core.step.tasklet.TaskletStep$2.doInChunkContext(TaskletStep.java:273)
    at org.springframework.batch.core.scope.context.StepContextRepeatCallback.doInIteration(StepContextRepeatCallback.java:82)
    at org.springframework.batch.repeat.support.RepeatTemplate.getNextResult(RepeatTemplate.java:375)
    at org.springframework.batch.repeat.support.RepeatTemplate.executeInternal(RepeatTemplate.java:215)
    at org.springframework.batch.repeat.support.RepeatTemplate.iterate(RepeatTemplate.java:145)
    at org.springframework.batch.core.step.tasklet.TaskletStep.doExecute(TaskletStep.java:258)
    at org.springframework.batch.core.step.AbstractStep.execute(AbstractStep.java:208)
    at com.im.batch.integration.partition.IMTaskExecutorPartitionHandler$PartitionTaskCallable.call(IMTaskExecutorPartitionHandler.java:63)
    at com.im.batch.integration.partition.IMTaskExecutorPartitionHandler$PartitionTaskCallable.call(IMTaskExecutorPartitionHandler.java:46)
    at java.util.concurrent.FutureTask.run(FutureTask.java:277)
    at org.springframework.scheduling.commonj.DelegatingWork.run(DelegatingWork.java:63)
    at com.ibm.ws.asynchbeans.J2EEContext.run(J2EEContext.java:1178)
    at com.ibm.ws.asynchbeans.WorkWithExecutionContextImpl.go(WorkWithExecutionContextImpl.java:199)
    at com.ibm.ws.asynchbeans.CJWorkItemImpl.run(CJWorkItemImpl.java:236)
    at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1892)
Caused by: com.ibm.wsspi.uow.UOWException: javax.transaction.HeuristicMixedException
    at com.ibm.ws.uow.embeddable.EmbeddableUOWManagerImpl.runUnderNewUOW(EmbeddableUOWManagerImpl.java:823)
    at com.ibm.ws.uow.embeddable.EmbeddableUOWManagerImpl.runUnderUOW(EmbeddableUOWManagerImpl.java:370)
    at org.springframework.transaction.jta.WebSphereUowTransactionManager.execute(WebSphereUowTransactionManager.java:306)
    ... 16 more

In sysout logs I am getting below error on the same time:

javax.transaction.xa.XAException: The method 'xa_commit' has failed with errorCode '-7' due to the resource being closed.
    at com.ibm.mq.jmqi.JmqiXAResource.commit(JmqiXAResource.java:460)
    at com.ibm.ejs.jms.JMSManagedSession$JMSXAResource.commit(JMSManagedSession.java:1444)
    at com.ibm.ejs.j2c.XATransactionWrapper.commit(XATransactionWrapper.java:496)
    at com.ibm.tx.jta.impl.JTAXAResourceImpl.commit(JTAXAResourceImpl.java:308)
    at com.ibm.tx.jta.impl.RegisteredResources.deliverOutcome(RegisteredResources.java:1644)
    at com.ibm.tx.jta.impl.RegisteredResources.distributeOutcome(RegisteredResources.java:2003)
    at com.ibm.tx.jta.impl.RegisteredResources.distributeCommit(RegisteredResources.java:2315)
    at com.ibm.tx.jta.impl.TransactionImpl.internalCommit(TransactionImpl.java:1911)
    at com.ibm.tx.jta.impl.TransactionImpl.internalCommit(TransactionImpl.java:1887)
    at com.ibm.tx.jta.impl.TransactionImpl.coreStage2CommitProcessing(TransactionImpl.java:1134)
    at com.ibm.tx.jta.impl.TransactionImpl.stage2CommitProcessing(TransactionImpl.java:1172)
    at com.ibm.tx.jta.impl.TransactionImpl.processCommit(TransactionImpl.java:1033)
    at com.ibm.tx.jta.impl.TransactionImpl.commit(TransactionImpl.java:963)
    at com.ibm.ws.tx.jta.TranManagerImpl.commit(TranManagerImpl.java:439)
    at com.ibm.tx.jta.impl.TranManagerSet.commit(TranManagerSet.java:191)
    at com.ibm.ws.uow.UOWManagerImpl.uowCommit(UOWManagerImpl.java:807)
    at com.ibm.ws.uow.embeddable.EmbeddableUOWManagerImpl.uowEnd(EmbeddableUOWManagerImpl.java:881)
    at com.ibm.ws.uow.UOWManagerImpl.uowEnd(UOWManagerImpl.java:782)
    at com.ibm.ws.uow.embeddable.EmbeddableUOWManagerImpl.runUnderNewUOW(EmbeddableUOWManagerImpl.java:818)
    at com.ibm.ws.uow.embeddable.EmbeddableUOWManagerImpl.runUnderUOW(EmbeddableUOWManagerImpl.java:370)
    at org.springframework.transaction.jta.WebSphereUowTransactionManager.execute(WebSphereUowTransactionManager.java:306)
    at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:134)
    at org.springframework.batch.core.step.tasklet.TaskletStep$2.doInChunkContext(TaskletStep.java:273)
    at org.springframework.batch.core.scope.context.StepContextRepeatCallback.doInIteration(StepContextRepeatCallback.java:82)
    at org.springframework.batch.repeat.support.RepeatTemplate.getNextResult(RepeatTemplate.java:375)
    at org.springframework.batch.repeat.support.RepeatTemplate.executeInternal(RepeatTemplate.java:215)
    at org.springframework.batch.repeat.support.RepeatTemplate.iterate(RepeatTemplate.java:145)
    at org.springframework.batch.core.step.tasklet.TaskletStep.doExecute(TaskletStep.java:258)
    at org.springframework.batch.core.step.AbstractStep.execute(AbstractStep.java:208)
    at com.im.batch.integration.partition.IMTaskExecutorPartitionHandler$PartitionTaskCallable.call(IMTaskExecutorPartitionHandler.java:63)

I have checked Aged Time out on websphere =0

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文