0 Replies Latest reply on Jan 7, 2004 3:53 AM by jt54

    XA with Ingres DB, throwing XAER_PROTO error code

    jt54 Newbie

      Environment:
      JBoss3.2.3, JDK1.3.1_01, Ingres 2.6 DB Server, EDBC JDBC Driver.

      When trying to do lookup for an EntityBean (CMP), the following error is seen:
      -------------------------------------
      11:24:10,156 INFO [RepurposeConsole] Class::Method: Entity bean look up to be done, M
      essage: hiRETRIEVAL
      11:24:10,196 WARN [TransactionImpl] XAException: tx=TransactionImpl:XidImpl [FormatId=
      257, GlobalId=ec2clipper108679//3, BranchQual=] errorCode=XAER_PROTO
      javax.transaction.xa.XAException
      at ca.edbc.jdbcx.EdbcXAConnect.start(EdbcXAConnect.java:349)
      at org.jboss.resource.adapter.jdbc.xa.XAManagedConnection.start(XAManagedConnec
      tion.java:143)
      at org.jboss.tm.TransactionImpl.startResource(TransactionImpl.java:1148)
      at org.jboss.tm.TransactionImpl.enlistResource(TransactionImpl.java:636)
      at org.jboss.resource.connectionmanager.TxConnectionManager$TxConnectionEventLi
      stener.enlist(TxConnectionManager.java:455)
      at org.jboss.resource.connectionmanager.TxConnectionManager.managedConnectionRe
      connected(TxConnectionManager.java:343)
      at org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateConnecti
      on(BaseConnectionManager2.java:483)
      at org.jboss.resource.connectionmanager.BaseConnectionManager2$ConnectionManage
      rProxy.allocateConnection(BaseConnectionManager2.java:814)
      at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataS
      ource.java:102)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCAbstractQueryCommand.execute(JDBCAbstract
      QueryCommand.java:149)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCAbstractQueryCommand.execute(JDBCAbstract
      QueryCommand.java:111)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCFindEntitiesCommand.execute(JDBCFindEntit
      iesCommand.java:38)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.findEntities(JDBCStoreManage
      r.java:579)
      at org.jboss.ejb.plugins.CMPPersistenceManager.findEntities(CMPPersistenceManag
      er.java:311)
      at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.findEntitie
      s(CachedConnectionInterceptor.java:322)
      at org.jboss.ejb.EntityContainer.find(EntityContainer.java:672)
      at java.lang.reflect.Method.invoke(Native Method)
      at org.jboss.ejb.EntityContainer$ContainerInterceptor.invokeHome(EntityContaine
      r.java:1043)
      at org.jboss.ejb.plugins.AbstractInterceptor.invokeHome(AbstractInterceptor.jav
      a:88)
      at org.jboss.ejb.plugins.EntitySynchronizationInterceptor.invokeHome(EntitySync
      hronizationInterceptor.java:197)
      at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invokeHome(
      CachedConnectionInterceptor.java:214)
      at org.jboss.ejb.plugins.AbstractInterceptor.invokeHome(AbstractInterceptor.jav
      a:88)
      at org.jboss.ejb.plugins.EntityInstanceInterceptor.invokeHome(EntityInstanceInt
      erceptor.java:89)
      at org.jboss.ejb.plugins.EntityLockInterceptor.invokeHome(EntityLockInterceptor
      .java:61)
      at org.jboss.ejb.plugins.EntityCreationInterceptor.invokeHome(EntityCreationInt
      erceptor.java:28)
      at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor
      .java:88)
      at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.
      java:267)
      at org.jboss.ejb.plugins.TxInterceptorCMT.invokeHome(TxInterceptorCMT.java:98)
      at org.jboss.ejb.plugins.SecurityInterceptor.invokeHome(SecurityInterceptor.jav
      a:92)
      at org.jboss.ejb.plugins.LogInterceptor.invokeHome(LogInterceptor.java:120)
      at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invokeHome(ProxyFactoryF
      inderInterceptor.java:93)
      at org.jboss.ejb.EntityContainer.internalInvokeHome(EntityContainer.java:483)
      at org.jboss.ejb.Container.invoke(Container.java:720)
      at java.lang.reflect.Method.invoke(Native Method)
      at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispat
      cher.java:284)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:546)
      at org.jboss.invocation.local.LocalInvoker.invoke(LocalInvoker.java:101)
      at org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:90)
      at org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.java:46
      )
      at org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:45)
      at org.jboss.proxy.ejb.HomeInterceptor.invoke(HomeInterceptor.java:173)
      at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:85)
      at $Proxy43.findByDelayedRepurposes(Unknown Source)
      at dams.damajama.repurpose.delaymonitor.sb_delaymonitor.MonitorBean.getDelayedR
      epurposes(MonitorBean.java:211)
      at dams.damajama.repurpose.delaymonitor.sb_delaymonitor.MonitorBean.sendMail(Mo
      nitorBean.java:152)
      at java.lang.reflect.Method.invoke(Native Method)
      at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(Stateles
      sSessionContainer.java:683)
      at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(Cach
      edConnectionInterceptor.java:185)
      at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSe
      ssionInstanceInterceptor.java:72)
      at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor
      .java:84)
      at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.
      java:267)
      at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:128)
      at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:11
      8)
      at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:191)
      at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinde
      rInterceptor.java:122)
      at org.jboss.ejb.StatelessSessionContainer.internalInvoke(StatelessSessionConta
      iner.java:331)
      at org.jboss.ejb.Container.invoke(Container.java:700)
      at org.jboss.ejb.plugins.local.BaseLocalProxyFactory.invoke(BaseLocalProxyFacto
      ry.java:375)
      at org.jboss.ejb.plugins.local.StatelessSessionProxy.invoke(StatelessSessionPro
      xy.java:83)
      at $Proxy45.sendMail(Unknown Source)
      at dams.damajama.repurpose.delaymonitor.DelayMonitor.perform(DelayMonitor.java:
      94)
      at org.jboss.varia.scheduler.Scheduler$Listener.handleNotification(Scheduler.ja
      va:1263)
      at org.jboss.mx.server.NotificationListenerProxy.handleNotification(Notificatio
      nListenerProxy.java:69)
      at javax.management.NotificationBroadcasterSupport.sendNotification(Notificatio
      nBroadcasterSupport.java:95)
      at javax.management.timer.Timer.sendNotifications(Timer.java:441)
      at javax.management.timer.Timer.access$000(Timer.java:31)
      at javax.management.timer.Timer$RegisteredNotification.doRun(Timer.java:612)
      at org.jboss.mx.util.SchedulableRunnable.run(SchedulableRunnable.java:164)
      at org.jboss.mx.util.ThreadPool$Worker.run(ThreadPool.java:225)
      11:24:10,616 INFO [TxConnectionManager] Could not enlist in transaction on entering me
      ta-aware object!
      javax.transaction.SystemException: enlistResource failed
      at org.jboss.resource.connectionmanager.TxConnectionManager$TxConnectionEventLi
      stener.enlist(TxConnectionManager.java:468)
      at org.jboss.resource.connectionmanager.TxConnectionManager.managedConnectionRe
      connected(TxConnectionManager.java:343)
      at org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateConnecti
      on(BaseConnectionManager2.java:483)
      at org.jboss.resource.connectionmanager.BaseConnectionManager2$ConnectionManage
      rProxy.allocateConnection(BaseConnectionManager2.java:814)
      at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataS
      ource.java:102)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCAbstractQueryCommand.execute(JDBCAbstract
      QueryCommand.java:149)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCAbstractQueryCommand.execute(JDBCAbstract
      QueryCommand.java:111)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCFindEntitiesCommand.execute(JDBCFindEntit
      iesCommand.java:38)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.findEntities(JDBCStoreManage
      r.java:579)
      at org.jboss.ejb.plugins.CMPPersistenceManager.findEntities(CMPPersistenceManag
      er.java:311)
      at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.findEntitie
      s(CachedConnectionInterceptor.java:322)
      at org.jboss.ejb.EntityContainer.find(EntityContainer.java:672)
      at java.lang.reflect.Method.invoke(Native Method)
      at org.jboss.ejb.EntityContainer$ContainerInterceptor.invokeHome(EntityContaine
      r.java:1043)
      at org.jboss.ejb.plugins.AbstractInterceptor.invokeHome(AbstractInterceptor.jav
      a:88)
      at org.jboss.ejb.plugins.EntitySynchronizationInterceptor.invokeHome(EntitySync
      hronizationInterceptor.java:197)
      at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invokeHome(
      CachedConnectionInterceptor.java:214)
      at org.jboss.ejb.plugins.AbstractInterceptor.invokeHome(AbstractInterceptor.jav
      a:88)
      at org.jboss.ejb.plugins.EntityInstanceInterceptor.invokeHome(EntityInstanceInt
      erceptor.java:89)
      at org.jboss.ejb.plugins.EntityLockInterceptor.invokeHome(EntityLockInterceptor
      .java:61)
      at org.jboss.ejb.plugins.EntityCreationInterceptor.invokeHome(EntityCreationInt
      erceptor.java:28)
      at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor
      .java:88)
      at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.
      java:267)
      at org.jboss.ejb.plugins.TxInterceptorCMT.invokeHome(TxInterceptorCMT.java:98)
      at org.jboss.ejb.plugins.SecurityInterceptor.invokeHome(SecurityInterceptor.jav
      a:92)
      at org.jboss.ejb.plugins.LogInterceptor.invokeHome(LogInterceptor.java:120)
      at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invokeHome(ProxyFactoryF
      inderInterceptor.java:93)
      at org.jboss.ejb.EntityContainer.internalInvokeHome(EntityContainer.java:483)
      at org.jboss.ejb.Container.invoke(Container.java:720)
      at java.lang.reflect.Method.invoke(Native Method)
      at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispat
      cher.java:284)
      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:546)
      at org.jboss.invocation.local.LocalInvoker.invoke(LocalInvoker.java:101)
      at org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:90)
      at org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.java:46
      )
      at org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:45)
      at org.jboss.proxy.ejb.HomeInterceptor.invoke(HomeInterceptor.java:173)
      at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:85)
      at $Proxy43.findByDelayedRepurposes(Unknown Source)
      at dams.damajama.repurpose.delaymonitor.sb_delaymonitor.MonitorBean.getDelayedR
      epurposes(MonitorBean.java:211)
      at dams.damajama.repurpose.delaymonitor.sb_delaymonitor.MonitorBean.sendMail(Mo
      nitorBean.java:152)
      -------------------------------------


      The same EntityBean and JBoss working without any problem with Oracle8i with classes12.zip JDBC driver.

      The code which is throwing error in JBoss env is:
      ca.edbc.jdbcx.EdbcXAConnect.start()

      The below mentioned standalone java program calling
      ca.edbc.jdbcx.EdbcXAConnect.start() method does not throw any error:

      ------------------
      import javax.sql.*;
      import java.sql.*;
      import javax.transaction.xa.*;

      import ca.edbc.jdbcx.*;
      import ca.edbc.jdbc.*;

      public class IngresXAConnection {
      public static void main(String args[]) {
      XAConnection xacon = null;
      XAResource xares = null;
      Connection con = null;
      Statement stmt = null;
      ResultSet rs = null;
      try {
      EdbcXADataSource xads = (EdbcXADataSource)(Class.forName("ca.edbc.jdbcx.EdbcXADataSource").newInstance());
      xads.setDatabaseName("repurpose");
      xads.setServerName("10.200.241.62");
      xads.setPortNumber(21064);
      xacon = xads.getXAConnection("ims", "ims");
      xares = xacon.getXAResource();
      CustomXid xid = new CustomXid();
      System.out.println("XAResource:" + xares);
      xares.start(xid, XAResource.TMNOFLAGS);
      System.out.println("EdbcXAConnect.start() got called.");

      /*
      Xid[] xid = xares.recover(XAResource.TMSTARTRSCAN);
      System.out.println("Xid[] =" + xid);
      xares.start(null, XAResource.TMNOFLAGS);
      if(xid != null && xid.length !=0) {
      xares.start(xid[0], XAResource.TMNOFLAGS);
      System.out.println("EdbcXAConnect.start() got called.");
      }
      */

      con = xacon.getConnection();
      stmt = con.createStatement();
      String strSql = "select * from repurpose";
      rs = stmt.executeQuery(strSql);
      if(rs.next()) {
      System.out.println("Value from database : " + rs.getString("repurpose_id"));
      }

      } catch(Exception e) {
      e.printStackTrace();
      } finally {
      try {
      if(rs != null) { rs.close(); }
      if(stmt != null) { stmt.close(); }
      if(con != null) { con.close(); }
      }catch(SQLException sqle) {
      sqle.printStackTrace();
      }
      }
      }
      }






      import javax.transaction.xa.*;

      public class CustomXid implements Xid {

      public byte[] getBranchQualifier() {
      return new byte[]{0,1,2};
      }

      public int getFormatId() {
      return 320;
      }

      public byte[] getGlobalTransactionId() {
      return new byte[]{0,1,2};
      }
      }
      ------------------

      Can JBoss gurus suggest what is wrong with JBoss modules?