3 Replies Latest reply on Mar 7, 2002 3:47 AM by bartmann_d

    OracleXAException when calling a method on a stateless sessi

    stevepark

      Everyone,
      I've been using JBoss for about six months. Recently we upgraded our server to Red Hat 7.2 and now we're getting this problem when trying to call a method on a stateless session bean that calls a CMP Entity Bean. Here are the gory details:

      Server Configuration:
      Red Hat 7.2 on a Dell Poweredge 2450
      JBoss 2.4.4 with Embedded Tomcat 3.2.3 binary
      Oracle 8.1.7
      iptables with ports 1099, 1521, 4444, 8082, 8083 and anonymous port 36512 open

      Error Message from server.log:
      [09:19:41,237,TxCapsule] XAException: tx=XidImpl [FormatId=257, GlobalId=dwiley.ed.usu.edu//1, BranchQual=] errorCode=XAER_RMERR
      oracle.jdbc.xa.OracleXAException
      at oracle.jdbc.xa.OracleXAResource.checkError(OracleXAResource.java:467)
      at oracle.jdbc.xa.client.OracleXAResource.start(OracleXAResource.java:122)
      at org.jboss.tm.TxCapsule.startResource(TxCapsule.java:1088)
      at org.jboss.tm.TxCapsule.enlistResource(TxCapsule.java:615)
      at org.jboss.tm.TransactionImpl.enlistResource(TransactionImpl.java:111)
      at org.jboss.pool.jdbc.xa.XAConnectionFactory.prepareObject(Unknown Source)
      at org.jboss.pool.ObjectPool.getObject(Unknown Source)
      at org.jboss.pool.ObjectPool.getObject(Unknown Source)
      at org.jboss.pool.jdbc.xa.XAPoolDataSource.getConnection(Unknown Source)
      at org.jboss.ejb.plugins.jaws.metadata.JawsApplicationMetaData.getConnection(JawsApplicationMetaData.java:109)
      at org.jboss.ejb.plugins.jaws.metadata.JawsEntityMetaData.getConnection(JawsEntityMetaData.java:218)
      at org.jboss.ejb.plugins.jaws.jdbc.JDBCCommand.getConnection(JDBCCommand.java:673)
      at org.jboss.ejb.plugins.jaws.jdbc.JDBCCommand.jdbcExecute(JDBCCommand.java:148)
      at org.jboss.ejb.plugins.jaws.jdbc.JDBCLoadEntityCommand.execute(JDBCLoadEntityCommand.java:147)
      at org.jboss.ejb.plugins.jaws.JAWSPersistenceManager.loadEntity(JAWSPersistenceManager.java:156)
      at org.jboss.ejb.plugins.CMPPersistenceManager.loadEntity(CMPPersistenceManager.java:362)
      at org.jboss.ejb.plugins.EntitySynchronizationInterceptor.invoke(EntitySynchronizationInterceptor.java:287)
      at org.jboss.ejb.plugins.EntityInstanceInterceptor.invoke(EntityInstanceInterceptor.java:197)
      at org.jboss.ejb.plugins.EntityLockInterceptor.invoke(EntityLockInterceptor.java:125)
      at org.jboss.ejb.plugins.TxInterceptorCMT.invokeNext(TxInterceptorCMT.java:138)
      at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:347)
      at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:100)
      at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:127)
      at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:170)
      at org.jboss.ejb.EntityContainer.invoke(EntityContainer.java:428)
      at org.jboss.ejb.plugins.jrmp.server.JRMPContainerInvoker.invoke(JRMPContainerInvoker.java:504)
      at org.jboss.ejb.plugins.jrmp.interfaces.GenericProxy.invokeContainer(GenericProxy.java:335)
      at org.jboss.ejb.plugins.jrmp.interfaces.EntityProxy.invoke(EntityProxy.java:133)
      at $Proxy23.getART_CT(Unknown Source)
      at edu.usu.pt3.tFolioInterface.tFolioInterfaceEJB.getStandardList(tFolioInterfaceEJB.java:108)
      at java.lang.reflect.Method.invoke(Native Method)
      at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:542)
      at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:82)
      at org.jboss.ejb.plugins.TxInterceptorCMT.invokeNext(TxInterceptorCMT.java:138)
      at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:347)
      at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:100)
      at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:127)
      at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:170)
      at org.jboss.ejb.StatelessSessionContainer.invoke(StatelessSessionContainer.java:286)
      at org.jboss.ejb.plugins.jrmp.server.JRMPContainerInvoker.invoke(JRMPContainerInvoker.java:410)
      at java.lang.reflect.Method.invoke(Native Method)
      at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:242)
      at sun.rmi.transport.Transport$1.run(Transport.java:155)
      at java.security.AccessController.doPrivileged(Native Method)
      at sun.rmi.transport.Transport.serviceCall(Transport.java:152)
      at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:462)
      at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:662)
      at java.lang.Thread.run(Thread.java:498)


      Here is the jboss.jcml configuration:


      oracle.jdbc.driver.OracleDriver



      DefaultDS
      oracle.jdbc.xa.client.OracleXADataSource

      jdbc:oracle:thin:@localhost:1521:ora8
      1200000
      *hidden*
      10
      *hidden*
      false
      false
      false
      true
      120000
      1800000
      false
      false
      1.0
      0
      TRANSACTION_SERIALIZABLE


      <!-- Connection factory for the Minerva JDBC resource adapter. This
      points at the same database as DefaultDS. -->

      MinervaDS
      JCA:service=RARDeployer

      Minerva JDBC LocalTransaction ResourceAdapter


      ConnectionURL=jdbc:oracle:thin:@localhost:1521:ora8



      Here's the source code for the session bean (EdStandard is an Entity CMP Bean):

      public Vector getStandardList(Integer sid) throws RemoteException, NamingException {
      try {
      int artCt = -1;
      Vector ni = new Vector();
      EdStandardHome esHome = (EdStandardHome)PortableRemoteObject.narrow(new InitialContext().lookup("EdStandard"), EdStandardHome.class);
      EdStandard es = null;
      for(Enumeration edStdEnum = esHome.findBySID(sid); edStdEnum.hasMoreElements(); ) {
      es = (EdStandard)edStdEnum.nextElement();
      artCt = es.getART_CT().intValue();
      if(artCt == 0) {
      ni.addElement(new NodeInfo(es.getID(), es.getSTD(), "empty standard"));
      }
      else if(artCt == 1) {
      ni.addElement(new NodeInfo(es.getID(), es.getSTD(), "half full standard"));
      }
      else if(artCt == 2) {
      ni.addElement(new NodeInfo(es.getID(), es.getSTD(), "full standard"));
      }
      }
      return ni;
      }
      catch(Exception e) {
      Vector errVector = new Vector();
      errVector.addElement(new NodeInfo("An Exception was caught: " + e.getMessage()));
      return errVector;
      }
      }

      Sorry this is so long. I've searched everywhere and can't figure out what's wrong with my configuration. Any insight into the problem would be very much appreciated.

      Steve

        • 1. Re: OracleXAException when calling a method on a stateless s
          bartmann_d

          I think I've got the same problem and it seems so as if it has something to do with the Oracle XADataSource.
          Last November I reported the bug http://sourceforge.net/tracker/?func=detail&atid=376685&aid=486416&group_id=22866 which addresses a completely different problem. But the interesting thing is that if I run my little test programm with the same setting as you with oracle.jdbc.xa.client.OracleXADataSource as DataSourceClass instead of org.jboss.pool.jdbc.xa.wrapper.XADataSourceImpl jboss throws exactly the same exception that you got (btw the actual bug vanishes with this setting). The business calls that are embedded in the client's UserTransaction succeed but the ones without a client's transaction fail with the OracleXAException thrown. When I change the transaction flag for all my bean's methods from Required to Supports everything is fine and no exception occurs. However this can't be the solution ...

          • 2. Re: OracleXAException when calling a method on a stateless s
            davidjencks

            Your configuration is pretty confusing. DefaultDS is using xa transactions, whereas MinervaDS is using local transactions. Get rid of the one you aren't using. My guess is you are using DefaultDS with xa transactions. Oracle has one of their "we know better than the rest of the universe combined, especially anyone who writes standards or specs" bugs in their xa handling in that they require you to use the Oracle Xid implementation rather than the jboss one. There's a comment somewhere in the default config file "uncomment to use Oracle xid". Try uncommenting that.

            I don't think it is a problem with Oracle, but you might try changing the tx isolation to read committed if the above doesn't work.

            • 3. Re: OracleXAException when calling a method on a stateless s
              bartmann_d

              Speaking for my code this doesn't change anything. I've already been using the Oracle Xid implementation and didn't touch the standard configuration of the MinervaDS. However I tried now with commenting MinervaDS completely out of the jboss.jcml but nothing changes (btw what is it good for? It solely serves as an example for how to configure a jca datasource, doesn't it?). Additionally I changed the tx isolation to read committed but since this is Oracle's default the exception still occurs.

              Since this problem is just one part of the puzzle I've been trying to put together without success I will now start a new thread "JBoss 2.4.4, Oracle and Transactions" ... perhaps someone can give me the clue that I need.