本文介绍了Websphere Application Server中的XAException的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我陷入一个困惑的问题,希望有人能帮助我.当尝试将一些代码部署到我们的IBM Websphere Application Server实例时,我遇到了此异常.有趣的是,它可以在本地运行(使用Atomikos for JTA在Tomcat上运行)

I'm stuck with a perplexing problem and I am hoping someone can help me out. I am getting this exception when trying some code that is deployed to our IBM Websphere Application Server instance. The funny part is that this works locally (running on Tomcat using Atomikos for JTA)

有什么想法吗?

错误消息

[9/8/13 12:33:53:726 EDT] 0000023e WSRdbXaResour E   DSRA0304E:  XAException occurred. XAException contents and details are: 
The XA Error is            : -3
The XA Error message is    : A resource manager error has occured in the transaction branch.
The Oracle Error code is   : 2045
The Oracle Error message is: Internal XA Error
The cause is               : null.
[9/8/13 12:33:53:757 EDT] 0000023e WSRdbXaResour E   DSRA0302E:  XAException occurred.  Error code is: XAER_RMERR (-3).  Exception is: <null>

系统详细信息

  • WAS版本:8.5.0.0
  • Oracle驱动程序版本:11.2.0.3.0
  • Oracle数据库版本:11.2.0.3.0
  • 操作系统:AIX 6.1 ppc64
  • 春季版本:3.2.3
  • 休眠版本:4.1.9
  • Javassist版本:3.17.1-GA

堆栈跟踪(在首次调用我的一项服务时被截断)

[9/8/13 12:33:53:634 EDT]     FFDC Exception:oracle.jdbc.xa.OracleXAException SourceId:com.ibm.ws.rsadapter.spi.WSRdbXaResourceImpl.start ProbeId:639 Reporter:com.ibm.ws.rsadapter.spi.WSRdbXaResourceImpl@12c29f91
oracle.jdbc.xa.OracleXAException
    at oracle.jdbc.xa.OracleXAResource.checkError(OracleXAResource.java:1110)
    at oracle.jdbc.xa.client.OracleXAResource.start(OracleXAResource.java:240)
    at com.ibm.ws.rsadapter.spi.WSRdbXaResourceImpl.start(WSRdbXaResourceImpl.java:1536)
    at com.ibm.ejs.j2c.XATransactionWrapper.start(XATransactionWrapper.java:1478)
    at com.ibm.ws.Transaction.JTA.JTAResourceBase.start(JTAResourceBase.java:153)
    at com.ibm.tx.jta.impl.RegisteredResources.startRes(RegisteredResources.java:1001)
    at com.ibm.ws.tx.jta.RegisteredResources.enlistResource(RegisteredResources.java:1114)
    at com.ibm.ws.tx.jta.TransactionImpl.enlistResource(TransactionImpl.java:2186)
    at com.ibm.tx.jta.embeddable.impl.EmbeddableTranManagerSet.enlist(EmbeddableTranManagerSet.java:154)
    at com.ibm.ejs.j2c.XATransactionWrapper.enlist(XATransactionWrapper.java:732)
    at com.ibm.ejs.j2c.ConnectionManager.lazyEnlist(ConnectionManager.java:2678)
    at com.ibm.ws.rsadapter.spi.WSRdbManagedConnectionImpl.lazyEnlist(WSRdbManagedConnectionImpl.java:2591)
    at com.ibm.ws.rsadapter.jdbc.WSJdbcConnection.beginTransactionIfNecessary(WSJdbcConnection.java:740)
    at com.ibm.ws.rsadapter.jdbc.WSJdbcConnection.prepareStatement(WSJdbcConnection.java:2789)
    at com.ibm.ws.rsadapter.jdbc.WSJdbcConnection.prepareStatement(WSJdbcConnection.java:2742)
    at sun.reflect.GeneratedMethodAccessor112.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
    at java.lang.reflect.Method.invoke(Method.java:611)
    at org.hibernate.engine.jdbc.internal.proxy.ConnectionProxyHandler.continueInvocation(ConnectionProxyHandler.java:138)
    at org.hibernate.engine.jdbc.internal.proxy.AbstractProxyHandler.invoke(AbstractProxyHandler.java:81)
    at $Proxy139.prepareStatement(Unknown Source)
    at org.hibernate.engine.jdbc.internal.StatementPreparerImpl$5.doPrepare(StatementPreparerImpl.java:147)
    at org.hibernate.engine.jdbc.internal.StatementPreparerImpl$StatementPreparationTemplate.prepareStatement(StatementPreparerImpl.java:166)
    at org.hibernate.engine.jdbc.internal.StatementPreparerImpl.prepareQueryStatement(StatementPreparerImpl.java:145)
    at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1854)
    at org.hibernate.loader.Loader.executeQueryStatement(Loader.java:1831)
    at org.hibernate.loader.Loader.executeQueryStatement(Loader.java:1811)
    at org.hibernate.loader.Loader.doQuery(Loader.java:899)
    at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:341)
    at org.hibernate.loader.Loader.doList(Loader.java:2516)
    at org.hibernate.loader.Loader.doList(Loader.java:2502)
    at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2332)
    at org.hibernate.loader.Loader.list(Loader.java:2327)
    at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:490)
    at org.hibernate.hql.internal.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:355)
    at org.hibernate.engine.query.spi.HQLQueryPlan.performList(HQLQueryPlan.java:195)
    at org.hibernate.internal.SessionImpl.list(SessionImpl.java:1247)
    at org.hibernate.internal.QueryImpl.list(QueryImpl.java:101)
    at org.hibernate.ejb.QueryImpl.getResultList(QueryImpl.java:264)
    at org.hibernate.ejb.criteria.CriteriaQueryCompiler$3.getResultList(CriteriaQueryCompiler.java:254)
    at ca.statcan.icos.admin.service.WorkAssignmentBusinessService.getOperationalSupervisors(WorkAssignmentBusinessService.java:180)
<snip>

预先感谢

推荐答案

事实证明,问题根本不在于WebSphere或Oracle,而是我们的配置.我们使用Spring AOP进行交易.在部署到WebSphere之前,我们还合并了几个Web项目.在合并过程中,我们最终得到了几个(确切地说是9个)用于设置AOP的applicationContext.xml文件.因此,对于包含在事务中的方法的每次调用,我们都会创建9个事务.

It turns out that the problem wasn't with WebSphere or Oracle at all, but our configuration. We use Spring AOP for transactions. We also have several web projects that we merge before deploying to WebSphere. During the merge we ended up with several (9 to be exact) applicationContext.xml files that setup AOP. Thus for every call to a method wrapped in a transaction we had 9 transactions created.

最终,我们达到了Oracle可以参与单个事务的全局事务数的限制,并且出现了此错误.

Eventually, we hit Oracle's limit of the number of global transactions that can participate in a single transaction and we got this error.

明智之举...在AOP管理的交易中要小心:)

Word to the wise ... be careful with AOP managed transactions :)

这篇关于Websphere Application Server中的XAException的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-12 21:23