Websphere Application Server中的XAException

时间:2013-09-08 16:58:36

标签: java oracle hibernate websphere websphere-8

我遇到了一个令人困惑的问题,我希望有人可以帮助我。我在尝试部署到IBM Websphere Application Server实例的代码时遇到此异常。有趣的是,这在本地工作(使用Atomikos for JTA在Tomcat上运行)

这里有什么想法?

错误消息

[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
  • Hibernate版本: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>

提前致谢

2 个答案:

答案 0 :(得分:0)

在大多数情况下,IBM支持建议您在与Oracle和WAS XA数据源达成协议时向Oracle用户授予特殊权限。

这是必需的补助金:

 grant select on pending_trans$ to <user>; 
 grant select on dba_2pc_pending to <user>;
 grant select on dba_pending_transactions to <user>;
 grant execute on dbms_system to <user>;  (If using Oracle 10.2.0.3 or lower JDBC driver)
 grant execute on dbms_xa to <user>; (If using Oracle 10.2.0.4 or higher JDBC driver)

答案 1 :(得分:0)

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

最终,我们达到了Oracle可以参与单个交易的全局交易数量限制,我们收到了此错误。

明智的话......小心AOP管理的交易:)