3 Replies Latest reply on Mar 6, 2003 12:08 PM by Jason Hill

    XA Problems in 3.2.0RC1

    Joey Levi Newbie

      Hello,

      I am trying to use an XA DataSource (with Oracle 9i). Here's the datasource definition:

      <xa-datasource>
      <jndi-name>jdbc/EstoreXADB</jndi-name>
      <track-connection-by-tx>true</track-connection-by-tx>
      <managedconnectionfactory-class>
      org.jboss.resource.adapter.jdbc.xa.oracle.XAOracleManagedConnectionFactory
      </managedconnectionfactory-class>
      <xa-datasource-class>oracle.jdbc.xa.client.OracleXADataSource</xa-datasource-class>
      <xa-datasource-property name="URL">jdbc:oracle:oci:@myDB</xa-datasource-property>
      <xa-datasource-property name="User">scott</xa-datasource-property>
      <xa-datasource-property name="Password">tiger</xa-datasource-property>
      </xa-datasource>

      I have deployed a simple EJB that gets a handle to the datasource directly (java:/jdbc/EstoreXADB) and uses it. Whenever my business method is invoked, I get this error:

      13:34:40,270 INFO [STDOUT] in ejbCreate()
      13:34:40,280 INFO [STDOUT] in getAll()
      13:34:45,948 INFO [STDOUT] got the connection
      13:34:45,958 INFO [STDOUT] created the statement
      13:34:45,958 INFO [STDOUT] executed the query
      13:34:46,198 WARN [TransactionImpl] XAException: tx=TransactionImpl:XidImpl [Fo
      rmatId=257, GlobalId=ELDIABLO//9, BranchQual=] errorCode=XAER_NOTA
      oracle.jdbc.xa.OracleXAException
      at oracle.jdbc.xa.OracleXAResource.checkError(OracleXAResource.java:1157
      )
      at oracle.jdbc.xa.client.OracleXAResource.end(OracleXAResource.java:450)

      at org.jboss.resource.adapter.jdbc.xa.XAManagedConnection.end(XAManagedC
      onnection.java:118)
      at org.jboss.tm.TransactionImpl.endResource(TransactionImpl.java:1096)
      at org.jboss.tm.TransactionImpl.endResources(TransactionImpl.java:1158)
      at org.jboss.tm.TransactionImpl.commit(TransactionImpl.java:337)
      at org.jboss.ejb.plugins.TxInterceptorCMT.endTransaction(TxInterceptorCM
      T.java:361)
      at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxIntercep
      torCMT.java:247)
      at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:1
      01)
      at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.
      java:130)
      at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:204)
      at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFacto
      ryFinderInterceptor.java:154)
      at org.jboss.ejb.StatelessSessionContainer.invoke(StatelessSessionContai
      ner.java:303)
      at org.jboss.ejb.Container.invoke(Container.java:680)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:549)
      at org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:
      340)
      at java.lang.reflect.Method.invoke(Native Method)
      at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:236)
      at sun.rmi.transport.Transport$1.run(Transport.java:147)
      at java.security.AccessController.doPrivileged(Native Method)
      at sun.rmi.transport.Transport.serviceCall(Transport.java:143)
      at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:4
      60)
      at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport
      .java:701)
      at java.lang.Thread.run(Thread.java:479)
      13:34:46,209 ERROR [LogInterceptor] TransactionRolledbackException:
      javax.transaction.TransactionRolledbackException: Unable to commit, tx=Transacti
      onImpl:XidImpl [FormatId=257, GlobalId=ELDIABLO//9, BranchQual=] status=STATUS_N
      O_TRANSACTION
      at org.jboss.ejb.plugins.TxInterceptorCMT.endTransaction(TxInterceptorCM
      T.java:368)
      at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxIntercep
      torCMT.java:247)
      at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:1
      01)
      at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.
      java:130)
      at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:204)
      at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFacto
      ryFinderInterceptor.java:154)
      at org.jboss.ejb.StatelessSessionContainer.invoke(StatelessSessionContai
      ner.java:303)
      at org.jboss.ejb.Container.invoke(Container.java:680)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:549)
      at org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:
      340)
      at java.lang.reflect.Method.invoke(Native Method)
      at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:236)
      at sun.rmi.transport.Transport$1.run(Transport.java:147)
      at java.security.AccessController.doPrivileged(Native Method)
      at sun.rmi.transport.Transport.serviceCall(Transport.java:143)
      at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:4
      60)
      at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport
      .java:701)
      at java.lang.Thread.run(Thread.java:479)

      I can get this to work with Local transactions, but not XA transactions. Is there something wrong with the datasource setup? I have used the JDBC Driver class and URL in JBuilder to connect to the database, so those don't seem to be the problem. And yes, I have an assembly descriptor tag with container transactions set to "Required" for all methods on both the home and remote interfaces for the EJB. The conatiner does not seem to be creating the transaction for me.

      I have alos attempted to set the transaction-type to "Bean" and get a handle to the UserTransaction. I get the same error.

      Thanks,

      Joey

        • 1. Re: XA Problems in 3.2.0RC1
          Jason Hill Newbie

          I'm having exactly the same problem with JBoss 3.2RC3 and Oracle 9i, using the thin JDBC driver. I switched to 3.2RC3 after failing to get it working with 3.0.4 using either the oci or the thin driver. Some of the posts I read said that they had fixed the XA problems with 3.2, but those posts were referencing Oracle 8.17. Has anyone successfully got XA the datasource configured with Oracle 9i. I'm converting a project over from Weblogic, everything seems to work fine except for this.

          16:06:05,796 WARN [TransactionImpl] XAException: tx=TransactionImpl:XidImpl [FormatId=257
          , GlobalId=renrtp-jhill3//9, BranchQual=] errorCode=XAER_NOTA
          oracle.jdbc.xa.OracleXAException
          at oracle.jdbc.xa.OracleXAResource.checkError(OracleXAResource.java:659)
          at oracle.jdbc.xa.client.OracleXAResource.end(OracleXAResource.java:305)
          at org.jboss.resource.adapter.jdbc.xa.XAManagedConnection.end(XAManagedConnection.
          java:146)
          at org.jboss.tm.TransactionImpl.endResource(TransactionImpl.java:1194)
          at org.jboss.tm.TransactionImpl.endResources(TransactionImpl.java:1267)
          at org.jboss.tm.TransactionImpl.commit(TransactionImpl.java:346)
          at org.jboss.ejb.plugins.TxInterceptorCMT.endTransaction(TxInterceptorCMT.java:367
          )
          at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.jav
          a:253)
          at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:104)
          at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:130)
          at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:208)
          at org.jboss.ejb.plugins.CleanShutdownInterceptor.invoke(CleanShutdownInterceptor.
          java:264)
          at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderIn
          terceptor.java:154)
          at org.jboss.ejb.StatelessSessionContainer.internalInvoke(StatelessSessionContaine
          r.java:322)
          at org.jboss.ejb.Container.invoke(Container.java:652)
          at java.lang.reflect.Method.invoke(Native Method)

          • 2. Re: XA Problems in 3.2.0RC1
            David Jencks Master

            Igor Fedorenko has oracle xa 9i working. I strongly recommend using 3.2RC3 or later, and be sure to start with the example config there (OracleXAManagedConnectionFactory is not necessary)

            Have you remembered to set pad true in the xid factory?

            I can't get Oracle to run at all, so I'm afraid I can't help further.

            • 3. Re: XA Problems in 3.2.0RC1
              Jason Hill Newbie

              Yes that was it!! I added the parameter to transaction-service.xml and everything works great. Thanks for the help