0 Replies Latest reply on Dec 17, 2003 8:24 AM by dvos2002

    jboss 3.2 XA datasource using a BMP entity bean

    dvos2002 Newbie

      Hi,

      I am trying to set up an entity bean that uses XA for a dataconnection. For generating the configuration I use XDoclets. I have copied the oracle-xa-ds.xml file to my deploy directory and changed the next lines

      <xa-datasource-property name="URL">jdbc:oracle:thin:@MYHOST:1521:MYDBNAME</xa-datasource-property>
      <xa-datasource-property name="User">douwe</xa-datasource-property>
      <xa-datasource-property name="Password">douwespassword</xa-datasource-property>
      



      the generated ejb-xml file

      <?xml version="1.0" encoding="UTF-8"?>
      <!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN" "http://java.sun.com/dtd/ejb-jar_2_0.dtd">
      
      <ejb-jar >
      
       <description>[CDATA[No Description.]]</description>
       <display-name>Generated by XDoclet</display-name>
      
       <enterprise-beans>
      
       <!-- Session Beans -->
       <session >
       <description>[CDATA[EJB That does something]]</description>
       <display-name>Stupid EJB</display-name>
      
       <ejb-name>Stupid</ejb-name>
      
       <home>com.dus.beantest.interfaces.StupidHome</home>
       <remote>com.dus.beantest.interfaces.Stupid</remote>
       <ejb-class>com.dus.beantest.ejb.StupidBean</ejb-class>
       <session-type>Stateless</session-type>
       <transaction-type>Container</transaction-type>
      
       </session>
      
       <session >
       <description>[CDATA[EJB That does something]]</description>
       <display-name>Transaction EJB</display-name>
      
       <ejb-name>Transaction</ejb-name>
      
       <home>com.dus.beantest.interfaces.TransactionHome</home>
       <remote>com.dus.beantest.interfaces.Transaction</remote>
       <ejb-class>com.dus.beantest.ejb.TransactionBean</ejb-class>
       <session-type>Stateless</session-type>
       <transaction-type>Container</transaction-type>
      
       </session>
      
       <!--
       To add session beans that you have deployment descriptor info for, add
       a file to your XDoclet merge directory called session-beans.xml that contains
       the <session></session> markup for those beans.
       -->
      
       <!-- Entity Beans -->
       <entity >
       <description>[CDATA[]]</description>
      
       <ejb-name>StupidDBBean</ejb-name>
      
       <home>com.dus.beantest.interfaces.StupidDBBeanHome</home>
       <remote>com.dus.beantest.interfaces.StupidDBBean</remote>
      
       <ejb-class>com.dus.beantest.ejb.StupidDBBeanBMP</ejb-class>
       <persistence-type>Bean</persistence-type>
       <prim-key-class>com.dus.beantest.ejb.StupidDBBeanPK</prim-key-class>
       <reentrant>False</reentrant>
      
       <resource-ref >
       <res-ref-name>DouwesResourceRef</res-ref-name>
       <res-type>javax.sql.XADatasource</res-type>
       <res-auth>Application</res-auth>
       </resource-ref>
      
       </entity>
      
       <!--
       To add entity beans that you have deployment descriptor info for, add
       a file to your XDoclet merge directory called entity-beans.xml that contains
       the <entity></entity> markup for those beans.
       -->
      
       <!-- Message Driven Beans -->
       <!--
       To add message driven beans that you have deployment descriptor info for, add
       a file to your XDoclet merge directory called message-driven-beans.xml that contains
       the <message-driven></message-driven> markup for those beans.
       -->
      
       </enterprise-beans>
      
       <!-- Relationships -->
      
       <!-- Assembly Descriptor -->
       <assembly-descriptor >
       <!--
       To add additional assembly descriptor info here, add a file to your
       XDoclet merge directory called assembly-descriptor.xml that contains
       the <assembly-descriptor></assembly-descriptor> markup.
       -->
      
       <!-- finder permissions -->
      
       <!-- finder permissions -->
      
       <!-- finder permissions -->
      
       <!-- transactions -->
      
       <!-- finder transactions -->
       </assembly-descriptor>
      
      </ejb-jar>
      


      the generated jboss.xml file

      <?xml version="1.0" encoding="UTF-8"?>
      <!DOCTYPE jboss PUBLIC "-//JBoss//DTD JBOSS 3.2//EN" "http://www.jboss.org/j2ee/dtd/jboss_3_2.dtd">
      
      <jboss>
      
       <enterprise-beans>
      
       <!--
       To add beans that you have deployment descriptor info for, add
       a file to your XDoclet merge directory called jboss-beans.xml that contains
       the <session></session>, <entity></entity> and <message-driven></message-driven>
       markup for those beans.
       -->
      
       <entity>
       <ejb-name>StupidDBBean</ejb-name>
       <jndi-name>StupidDBBean</jndi-name>
       <resource-ref>
       <res-ref-name>DouwesResourceRef</res-ref-name>
       <jndi-name>jdbc/XAOracleDS</jndi-name>
       </resource-ref>
      
       <method-attributes>
       </method-attributes>
      
       </entity>
      
       <session>
       <ejb-name>Stupid</ejb-name>
       <jndi-name>ejb/beantest/Stupid</jndi-name>
      
       <method-attributes>
       </method-attributes>
       </session>
       <session>
       <ejb-name>Transaction</ejb-name>
       <jndi-name>ejb/beantest/Transaction</jndi-name>
      
       <method-attributes>
       </method-attributes>
       </session>
      
       </enterprise-beans>
      
       <resource-managers>
       <resource-manager>
       <res-name>ResManagerName</res-name>
       <res-jndi-name>ResManJndiName</res-jndi-name>
       </resource-manager>
       </resource-managers>
      
      </jboss>
      



      The datasource appears to be accepted by JBoss:

      10:14:15,653 INFO [MainDeployer] Starting deployment of package: file:/C:/jboss-3.2.2/server/default/deploy/oracle-xa-ds.xml
      10:14:15,843 INFO [RARDeployment] Started jboss.jca:service=ManagedConnectionFactory,name=XAOracleDS
      10:14:15,863 INFO [JBossManagedConnectionPool] Started jboss.jca:service=ManagedConnectionPool,name=XAOracleDS
      10:14:15,923 INFO [OracleXAExceptionFormatter] Started jboss.jca:service=OracleXAExceptionFormatter
      10:14:15,943 INFO [MainDeployer] Deployed package: file:/C:/jboss-3.2.2/server/default/deploy/oracle-xa-ds.xml
      



      Unfortunately (for me) when trying to invoke the methods on the BMP entity bean I get an XAException:

      14:32:21,811 WARN [TransactionImpl] XAException: tx=TransactionImpl:XidImpl [FormatId=257, GlobalId=vw-5897//19, BranchQual=] errorCode=XAER_RMERR
       oracle.jdbc.xa.OracleXAException
       at oracle.jdbc.xa.OracleXAResource.checkError(OracleXAResource.java:1159)
       at oracle.jdbc.xa.client.OracleXAResource.start(OracleXAResource.java:311)
       at org.jboss.resource.adapter.jdbc.xa.XAManagedConnection.start(XAManagedConnection.java:142)
       at org.jboss.tm.TransactionImpl.startResource(TransactionImpl.java:1144)
       at org.jboss.tm.TransactionImpl.enlistResource(TransactionImpl.java:632)
       at org.jboss.resource.connectionmanager.TxConnectionManager$TxConnectionEventListener.enlist(TxConnectionManager.java:443)
       at org.jboss.resource.connectionmanager.TxConnectionManager.managedConnectionReconnected(TxConnectionManager.java:343)
       at org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateConnection(BaseConnectionManager2.java:483)
       at org.jboss.resource.connectionmanager.BaseConnectionManager2$ConnectionManagerProxy.allocateConnection(BaseConnectionManager2.java:814)
       at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:102)
       at com.dus.beantest.ejb.StupidDBDAOImpl.store(StupidDBDAOImpl.java:85)
       at com.dus.beantest.ejb.StupidDBBeanBMP.ejbStore(StupidDBBeanBMP.java:116)
       at java.lang.reflect.Method.invoke(Native Method)
       at org.jboss.ejb.plugins.BMPPersistenceManager.storeEntity(BMPPersistenceManager.java:454)
       at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.storeEntity(CachedConnectionInterceptor.java:387)
       at org.jboss.ejb.EntityContainer.storeEntity(EntityContainer.java:713)
       at org.jboss.ejb.GlobalTxEntityMap.synchronizeEntities(GlobalTxEntityMap.java:149)
       at org.jboss.ejb.GlobalTxEntityMap$GlobalTxEntityMapSynchronize.beforeCompletion(GlobalTxEntityMap.java:215)
       at org.jboss.tm.TransactionImpl.doBeforeCompletion(TransactionImpl.java:1304)
       at org.jboss.tm.TransactionImpl.commit(TransactionImpl.java:343)
       at org.jboss.tm.TxManager.commit(TxManager.java:141)
       at org.jboss.tm.usertx.server.UserTransactionSessionImpl.commit(UserTransactionSessionImpl.java:165)
       at java.lang.reflect.Method.invoke(Native Method)
       at org.jboss.tm.usertx.server.ClientUserTransactionService.invoke(ClientUserTransactionService.java:107)
       at java.lang.reflect.Method.invoke(Native Method)
       at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:546)
       at org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:367)
       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:460)
       at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
       at java.lang.Thread.run(Thread.java:479)
      14:32:22,221 WARN [TransactionImpl] xa error: -3 (A resource manager error hasoccured in the transaction branch.); oracle error: 6550; oracle sql error: 0;
       oracle.jdbc.xa.OracleXAException
       at oracle.jdbc.xa.OracleXAResource.checkError(OracleXAResource.java:1159)
       at oracle.jdbc.xa.client.OracleXAResource.start(OracleXAResource.java:311)
       at org.jboss.resource.adapter.jdbc.xa.XAManagedConnection.start(XAManagedConnection.java:142)
       at org.jboss.tm.TransactionImpl.startResource(TransactionImpl.java:1144)
       at org.jboss.tm.TransactionImpl.enlistResource(TransactionImpl.java:632)
       at org.jboss.resource.connectionmanager.TxConnectionManager$TxConnectionEventListener.enlist(TxConnectionManager.java:443)
       at org.jboss.resource.connectionmanager.TxConnectionManager.managedConnectionReconnected(TxConnectionManager.java:343)
       at org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateConnection(BaseConnectionManager2.java:483)
       at org.jboss.resource.connectionmanager.BaseConnectionManager2$ConnectionManagerProxy.allocateConnection(BaseConnectionManager2.java:814)
       at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:102)
       at com.dus.beantest.ejb.StupidDBDAOImpl.store(StupidDBDAOImpl.java:85)
       at com.dus.beantest.ejb.StupidDBBeanBMP.ejbStore(StupidDBBeanBMP.java:116)
       at java.lang.reflect.Method.invoke(Native Method)
       at org.jboss.ejb.plugins.BMPPersistenceManager.storeEntity(BMPPersistenceManager.java:454)
       at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.storeEntity(CachedConnectionInterceptor.java:387)
       at org.jboss.ejb.EntityContainer.storeEntity(EntityContainer.java:713)
       at org.jboss.ejb.GlobalTxEntityMap.synchronizeEntities(GlobalTxEntityMap.java:149)
       at org.jboss.ejb.GlobalTxEntityMap$GlobalTxEntityMapSynchronize.beforeCompletion(GlobalTxEntityMap.java:215)
       at org.jboss.tm.TransactionImpl.doBeforeCompletion(TransactionImpl.java:1304)
       at org.jboss.tm.TransactionImpl.commit(TransactionImpl.java:343)
       at org.jboss.tm.TxManager.commit(TxManager.java:141)
       at org.jboss.tm.usertx.server.UserTransactionSessionImpl.commit(UserTransactionSessionImpl.java:165)
       at java.lang.reflect.Method.invoke(Native Method)
       at org.jboss.tm.usertx.server.ClientUserTransactionService.invoke(ClientUserTransactionService.java:107)
       at java.lang.reflect.Method.invoke(Native Method)
       at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:546)
       at org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:367)
       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:460)
       at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
       at java.lang.Thread.run(Thread.java:479)
      14:32:22,582 INFO [TxConnectionManager] Could not enlist in transaction on entering meta-aware object!
       javax.transaction.SystemException: enlistResource failed
       at org.jboss.resource.connectionmanager.TxConnectionManager$TxConnectionEventListener.enlist(TxConnectionManager.java:456)
       at org.jboss.resource.connectionmanager.TxConnectionManager.managedConnectionReconnected(TxConnectionManager.java:343)
       at org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateConnection(BaseConnectionManager2.java:483)
       at org.jboss.resource.connectionmanager.BaseConnectionManager2$ConnectionManagerProxy.allocateConnection(BaseConnectionManager2.java:814)
       at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:102)
       at com.dus.beantest.ejb.StupidDBDAOImpl.store(StupidDBDAOImpl.java:85)
       at com.dus.beantest.ejb.StupidDBBeanBMP.ejbStore(StupidDBBeanBMP.java:116)
       at java.lang.reflect.Method.invoke(Native Method)
       at org.jboss.ejb.plugins.BMPPersistenceManager.storeEntity(BMPPersistenceManager.java:454)
       at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.storeEntity(CachedConnectionInterceptor.java:387)
       at org.jboss.ejb.EntityContainer.storeEntity(EntityContainer.java:713)
       at org.jboss.ejb.GlobalTxEntityMap.synchronizeEntities(GlobalTxEntityMap.java:149)
       at org.jboss.ejb.GlobalTxEntityMap$GlobalTxEntityMapSynchronize.beforeCompletion(GlobalTxEntityMap.java:215)
       at org.jboss.tm.TransactionImpl.doBeforeCompletion(TransactionImpl.java:1304)
       at org.jboss.tm.TransactionImpl.commit(TransactionImpl.java:343)
       at org.jboss.tm.TxManager.commit(TxManager.java:141)
       at org.jboss.tm.usertx.server.UserTransactionSessionImpl.commit(UserTransactionSessionImpl.java:165)
       at java.lang.reflect.Method.invoke(Native Method)
       at org.jboss.tm.usertx.server.ClientUserTransactionService.invoke(ClientUserTransactionService.java:107)
       at java.lang.reflect.Method.invoke(Native Method)
       at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:546)
       at org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:367)
       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:460)
       at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
       at java.lang.Thread.run(Thread.java:479)
      14:32:22,902 ERROR [STDERR] org.jboss.util.NestedSQLException: Could not enlist in transaction on entering meta-aware object!javax.transaction.SystemException:
       enlistResource failed; - nested throwable: (javax.resource.ResourceException: Could not enlist in transaction on entering meta-aware object!javax.transaction.SystemException: enlistResource failed)
      14:32:22,932 ERROR [STDERR] at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:106)
      14:32:22,942 ERROR [STDERR] at com.dus.beantest.ejb.StupidDBDAOImpl.store(StupidDBDAOImpl.java:85)
      14:32:22,952 ERROR [STDERR] at com.dus.beantest.ejb.StupidDBBeanBMP.ejbStore(StupidDBBeanBMP.java:116)
      14:32:22,972 ERROR [STDERR] at java.lang.reflect.Method.invoke(Native Method)
      14:32:22,982 ERROR [STDERR] at org.jboss.ejb.plugins.BMPPersistenceManager.storeEntity(BMPPersistenceManager.java:454)
      14:32:22,992 ERROR [STDERR] at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.storeEntity(CachedConnectionInterceptor.java:387)
      14:32:23,002 ERROR [STDERR] at org.jboss.ejb.EntityContainer.storeEntity(EntityContainer.java:713)
      14:32:23,022 ERROR [STDERR] at org.jboss.ejb.GlobalTxEntityMap.synchronizeEntities(GlobalTxEntityMap.java:149)
      14:32:23,032 ERROR [STDERR] at org.jboss.ejb.GlobalTxEntityMap$GlobalTxEntityMapSynchronize.beforeCompletion(GlobalTxEntityMap.java:215)
      14:32:23,043 ERROR [STDERR] at org.jboss.tm.TransactionImpl.doBeforeCompletion(TransactionImpl.java:1304)
      14:32:23,053 ERROR [STDERR] at org.jboss.tm.TransactionImpl.commit(TransactionImpl.java:343)
      14:32:23,073 ERROR [STDERR] at org.jboss.tm.TxManager.commit(TxManager.java:141)
      14:32:23,083 ERROR [STDERR] at org.jboss.tm.usertx.server.UserTransactionSessionImpl.commit(UserTransactionSessionImpl.java:165)
      14:32:23,093 ERROR [STDERR] at java.lang.reflect.Method.invoke(Native Method)
      14:32:23,113 ERROR [STDERR] at org.jboss.tm.usertx.server.ClientUserTransactionService.invoke(ClientUserTransactionService.java:107)
      14:32:23,123 ERROR [STDERR] at java.lang.reflect.Method.invoke(Native Method)
      14:32:23,133 ERROR [STDERR] at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
      14:32:23,153 ERROR [STDERR] at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:546)
      14:32:23,163 ERROR [STDERR] at org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:367)
      14:32:23,173 ERROR [STDERR] at java.lang.reflect.Method.invoke(Native Method)
      14:32:23,183 ERROR [STDERR] at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:236)
      14:32:23,203 ERROR [STDERR] at sun.rmi.transport.Transport$1.run(Transport.java:147)
      14:32:23,213 ERROR [STDERR] at java.security.AccessController.doPrivileged(Native Method)
      14:32:23,223 ERROR [STDERR] at sun.rmi.transport.Transport.serviceCall(Transport.java:143)
      14:32:23,233 ERROR [STDERR] at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
      14:32:23,253 ERROR [STDERR] at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
      14:32:23,263 ERROR [STDERR] at java.lang.Thread.run(Thread.java:479)
      14:32:23,273 ERROR [STDERR] + nested throwable:
      14:32:23,273 ERROR [STDERR] javax.resource.ResourceException: Could not enlist in transaction on entering meta-aware object!javax.transaction.SystemException: enlistResource failed
      14:32:23,293 ERROR [STDERR] at org.jboss.resource.connectionmanager.TxConnectionManager.managedConnectionReconnected(TxConnectionManager.java:348)
      14:32:23,313 ERROR [STDERR] at org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateConnection(BaseConnectionManager2.java:483)
      14:32:23,323 ERROR [STDERR] at org.jboss.resource.connectionmanager.BaseConnectionManager2$ConnectionManagerProxy.allocateConnection(BaseConnectionManager2.java:814)
      14:32:23,343 ERROR [STDERR] at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:102)
      14:32:23,353 ERROR [STDERR] at com.dus.beantest.ejb.StupidDBDAOImpl.store(StupidDBDAOImpl.java:85)
      14:32:23,363 ERROR [STDERR] at com.dus.beantest.ejb.StupidDBBeanBMP.ejbStore(StupidDBBeanBMP.java:116)
      14:32:23,383 ERROR [STDERR] at java.lang.reflect.Method.invoke(Native Method)
      14:32:23,393 ERROR [STDERR] at org.jboss.ejb.plugins.BMPPersistenceManager.storeEntity(BMPPersistenceManager.java:454)
      14:32:23,403 ERROR [STDERR] at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.storeEntity(CachedConnectionInterceptor.java:387)
      14:32:23,413 ERROR [STDERR] at org.jboss.ejb.EntityContainer.storeEntity(EntityContainer.java:713)
      14:32:23,433 ERROR [STDERR] at org.jboss.ejb.GlobalTxEntityMap.synchronizeEntities(GlobalTxEntityMap.java:149)
      14:32:23,443 ERROR [STDERR] at org.jboss.ejb.GlobalTxEntityMap$GlobalTxEntityMapSynchronize.beforeCompletion(GlobalTxEntityMap.java:215)
      14:32:23,453 ERROR [STDERR] at org.jboss.tm.TransactionImpl.doBeforeCompletion(TransactionImpl.java:1304)
      14:32:23,473 ERROR [STDERR] at org.jboss.tm.TransactionImpl.commit(TransactionImpl.java:343)
      14:32:23,483 ERROR [STDERR] at org.jboss.tm.TxManager.commit(TxManager.java:141)
      14:32:23,493 ERROR [STDERR] at org.jboss.tm.usertx.server.UserTransactionSessionImpl.commit(UserTransactionSessionImpl.java:165)
      14:32:23,503 ERROR [STDERR] at java.lang.reflect.Method.invoke(Native Method)
      14:32:23,523 ERROR [STDERR] at org.jboss.tm.usertx.server.ClientUserTransactionService.invoke(ClientUserTransactionService.java:107)
      14:32:23,533 ERROR [STDERR] at java.lang.reflect.Method.invoke(Native Method)
      14:32:23,543 ERROR [STDERR] at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
      14:32:23,563 ERROR [STDERR] at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:546)
      14:32:23,573 ERROR [STDERR] at org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:367)
      14:32:23,583 ERROR [STDERR] at java.lang.reflect.Method.invoke(Native Method)
      14:32:23,603 ERROR [STDERR] at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:236)
      14:32:23,613 ERROR [STDERR] at sun.rmi.transport.Transport$1.run(Transport.java:147)
      14:32:23,623 ERROR [STDERR] at java.security.AccessController.doPrivileged(Native Method)
      14:32:23,633 ERROR [STDERR] at sun.rmi.transport.Transport.serviceCall(Transport.java:143)
      14:32:23,653 ERROR [STDERR] at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
      14:32:23,663 ERROR [STDERR] at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
      14:32:23,673 ERROR [STDERR] at java.lang.Thread.run(Thread.java:479)
      14:32:23,683 INFO [STDOUT] Leaving ManagerDAOImpl.store()
      14:32:23,703 WARN [TransactionImpl] XAException: tx=TransactionImpl:XidImpl [FormatId=257, GlobalId=vw-5897//19, BranchQual=] errorCode=XAER_RMERR
      oracle.jdbc.xa.OracleXAException
       at oracle.jdbc.xa.OracleXAResource.checkError(OracleXAResource.java:1159)
       at oracle.jdbc.xa.client.OracleXAResource.commit(OracleXAResource.java:616)
       at org.jboss.resource.adapter.jdbc.xa.XAManagedConnection.commit(XAManagedConnection.java:184)
       at org.jboss.tm.TransactionImpl.commitResources(TransactionImpl.java:1589)
       at org.jboss.tm.TransactionImpl.commit(TransactionImpl.java:371)
       at org.jboss.tm.TxManager.commit(TxManager.java:141)
       at org.jboss.tm.usertx.server.UserTransactionSessionImpl.commit(UserTransactionSessionImpl.java:165)
       at java.lang.reflect.Method.invoke(Native Method)
       at org.jboss.tm.usertx.server.ClientUserTransactionService.invoke(ClientUserTransactionService.java:107)
       at java.lang.reflect.Method.invoke(Native Method)
       at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:546)
       at org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:367)
       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:460)
       at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
       at java.lang.Thread.run(Thread.java:479)
      14:32:23,904 WARN [TransactionImpl] xa error: -3 (A resource manager error hasoccured in the transaction branch.); oracle error: 6550; oracle sql error: 0;
      oracle.jdbc.xa.OracleXAException
       at oracle.jdbc.xa.OracleXAResource.checkError(OracleXAResource.java:1159)
       at oracle.jdbc.xa.client.OracleXAResource.commit(OracleXAResource.java:616)
       at org.jboss.resource.adapter.jdbc.xa.XAManagedConnection.commit(XAManagedConnection.java:184)
       at org.jboss.tm.TransactionImpl.commitResources(TransactionImpl.java:1589)
       at org.jboss.tm.TransactionImpl.commit(TransactionImpl.java:371)
       at org.jboss.tm.TxManager.commit(TxManager.java:141)
       at org.jboss.tm.usertx.server.UserTransactionSessionImpl.commit(UserTransactionSessionImpl.java:165)
       at java.lang.reflect.Method.invoke(Native Method)
       at org.jboss.tm.usertx.server.ClientUserTransactionService.invoke(ClientUserTransactionService.java:107)
       at java.lang.reflect.Method.invoke(Native Method)
       at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:546)
       at org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:367)
       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:460)
       at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
       at java.lang.Thread.run(Thread.java:479)
      14:32:24,114 WARN [TransactionImpl] XAException: tx=TransactionImpl:XidImpl [FormatId=257, GlobalId=vw-5897//19, BranchQual=] errorCode=XAER_RMERR
      oracle.jdbc.xa.OracleXAException
       at oracle.jdbc.xa.OracleXAResource.checkError(OracleXAResource.java:1159)
       at oracle.jdbc.xa.client.OracleXAResource.rollback(OracleXAResource.java:1025)
       at org.jboss.resource.adapter.jdbc.xa.XAManagedConnection.rollback(XAManagedConnection.java:194)
       at org.jboss.tm.TransactionImpl.rollbackResources(TransactionImpl.java:1660)
       at org.jboss.tm.TransactionImpl.commit(TransactionImpl.java:399)
       at org.jboss.tm.TxManager.commit(TxManager.java:141)
       at org.jboss.tm.usertx.server.UserTransactionSessionImpl.commit(UserTransactionSessionImpl.java:165)
       at java.lang.reflect.Method.invoke(Native Method)
       at org.jboss.tm.usertx.server.ClientUserTransactionService.invoke(ClientUserTransactionService.java:107)
       at java.lang.reflect.Method.invoke(Native Method)
       at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:546)
       at org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:367)
       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:460)
       at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
       at java.lang.Thread.run(Thread.java:479)
      14:32:24,314 WARN [TransactionImpl] xa error: -3 (A resource manager error hasoccured in the transaction branch.); oracle error: 6550; oracle sql error: 0;
      oracle.jdbc.xa.OracleXAException
       at oracle.jdbc.xa.OracleXAResource.checkError(OracleXAResource.java:1159)
       at oracle.jdbc.xa.client.OracleXAResource.rollback(OracleXAResource.java:1025)
       at org.jboss.resource.adapter.jdbc.xa.XAManagedConnection.rollback(XAManagedConnection.java:194)
       at org.jboss.tm.TransactionImpl.rollbackResources(TransactionImpl.java:1660)
       at org.jboss.tm.TransactionImpl.commit(TransactionImpl.java:399)
       at org.jboss.tm.TxManager.commit(TxManager.java:141)
       at org.jboss.tm.usertx.server.UserTransactionSessionImpl.commit(UserTransactionSessionImpl.java:165)
       at java.lang.reflect.Method.invoke(Native Method)
       at org.jboss.tm.usertx.server.ClientUserTransactionService.invoke(ClientUserTransactionService.java:107)
       at java.lang.reflect.Method.invoke(Native Method)
       at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:546)
       at org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:367)
       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:460)
       at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
       at java.lang.Thread.run(Thread.java:479)
      






      the bean itself:

      /*
       * Created on 05.12.2003
       */
      package com.dus.beantest.ejb;
      //import com.dus.beantest.ejb;
      import javax.ejb.*;
      import javax.transaction.*;
      import javax.transaction.xa.*;
      
      import java.rmi.*;
      
      /**
       * @author dvos
       * @ejb:bean name = "StupidDBBean"
       * type = "BMP"
       * view-type = "remote"
       * local-jndi-name = "test.interfaces.RolesLocalHome"
       * schema = "Roles"
       * transaction-type = "Bean"
       *
       * @ejb.util generate = "physical"
       * @ejb:value-object name = "Roles"
       * match = "*"
       *
       * @ejb.persistence table-name = "testje"
       *
       * @jboss.persistence create-table="true"
       * remove-table="true"
       *
       * @jboss.resource-manager res-man-name = "ResManagerName"
       * res-man-jndi-name = "ResManJndiName"
       *
       * @jboss.resource-ref res-ref-name="XAOracleDS"
       * jndi-name="jdbc/XAOracleDS"
       *
       * @ejb.resource-ref res-ref-name="XAOracleDS"
       * jndi-name="jdbc/XAOracleDS"
       * res-type = "javax.sql.XADatasource"
       * res-auth = "Application"
       *
       * @ejb.dao class = "com.dus.beantest.ejb.StupidDBDAO"
       * impl-class = "com.dus.beantest.ejb.StupidDBDAOImpl"
       *
       * generate = "true"
       */
      public abstract class StupidDBBean implements EntityBean {
      
       private int userID;
       private String name, lastname;
      
       /**
       * Returns the userID
       * @return the userID
       * @ejb.persistence
       * @ejb.pk-field
       * @ejb.interface-method
       */
       public int getUserID(){
       return userID;
       }
      
       /**
       * Sets the userID
       * @param int the new userID value
       * @ejb.interface-method
       */
       public void setUserID(int userID) {
       this.userID = userID;
       }
      
      
       /**
       * Returns the name
       * @return the name
       *
       * @ejb.persistence
       * @ejb.interface-method
       */
       public String getName() {
       return name;
       }
      
       /**
       * Sets the name
       *
       * @param java.lang.String the new name value
       * @ejb.interface-method
       */
       public void setName(String name) {
       this.name = name;
       }
      
      
      
       /**
       * Returns the lastname
       * @return the lastname
       *
       * @ejb.persistence
       * @ejb.interface-method
       */
       public String getLastName() {
       return lastname;
       }
      
       /**
       * Sets the lastname
       *
       * @param java.lang.String the new name value
       * @ejb.interface-method
       */
       public void setLastName(String lastname) {
       this.lastname = lastname;
       }
      
      
       /**
       * Finds the Primary Key
       * @return StupidDBBeanPK object
       *
       * @param StupidDBBeanPK userID value
       */
       public StupidDBBeanPK ejbFindByPrimaryKey(StupidDBBeanPK key) throws FinderException{
       System.out.println ("Entering ManagerBean.ejbFindByUserID ");
       System.out.println ("Leaving ManagerBean.ejbFindByUserID ");
       return null;
       }
      
      
       /**
       * @throws CreateException
       * @ejb.create-method
       */
       public StupidDBBeanPK ejbCreate() throws CreateException {
       return null;
       }
      
      
       EntityContext ctx;
      
       public void setEntityContext(EntityContext arg0) throws EJBException, RemoteException {
       ctx = arg0;
       }
      
       public void unsetEntityContext() throws EJBException, RemoteException {
       ctx = null;
       }
      
       public EntityContext getContext() {
       return ctx;
       }
      
      }
      



      ant the DAOImpl class

      /*
       * Created on 12.12.2003
       */
      package com.dus.beantest.ejb;
      
      import java.sql.Connection;
      import java.sql.PreparedStatement;
      import java.sql.ResultSet;
      import java.sql.SQLException;
      import javax.ejb.EJBException;
      import javax.ejb.FinderException;
      import javax.naming.InitialContext;
      import javax.sql.DataSource;
      
      
      /**
       * @author dvos
       */
      public class StupidDBDAOImpl implements StupidDBDAO {
      
       private DataSource jdbcFactory;
      
       public StupidDBDAOImpl() {
       super();
       }
      
       public void init() {
       System.out.println (" Entering ManageDAOImpl.init() ");
      
       InitialContext c = null ;
       if (this.jdbcFactory == null ){
       try {
       c = new InitialContext() ;
       this.jdbcFactory= (DataSource) c.lookup("java:XAOracleDS");
       }catch (Exception e) {
       System.out.println ("Error in ManagerDAOImpl.init() ");
       }
       }
       System.out.println (" Leaving ManagerDAOImpl.init() ");
       }
      
       public void load(StupidDBBeanPK pk, StupidDBBean ejb) throws javax.ejb.EJBException {
       System.out.println (" Entering ManagerDAOImpl.load() ");
      
       Connection conn = null;
       PreparedStatement ps = null;
       ResultSet rs = null;
       try {
       conn = jdbcFactory.getConnection();
       String queryString = "SELECT KEY, NAME, LASTNAME FROM TESTJE WHERE KEY = ?";
       ps = conn.prepareStatement(queryString);
       ps.setInt(1, pk.getUserID());
       rs = ps.executeQuery();
       System.out.println ("QueryString is " + queryString) ;
       if ( rs.next() ) {
       int count =1;
       ejb.setUserID(rs.getInt(count++));
       ejb.setName((rs.getString(count++)).trim());
       ejb.setLastName((rs.getString(count++)).trim());
       }
       }
       catch (SQLException e) {
       throw new EJBException("Row for id " + pk.userID + " not found in database" + e);
       }
       finally {
       try {
       rs.close();
       ps.close();
       conn.close();
       } catch (Exception e) {}
       }
       System.out.println (" Leaving ManagerDAOImpl.load() ") ;
       }
       public void store(StupidDBBean ejb) throws javax.ejb.EJBException {
      
       System.out.println (" Entering ManagerDAOImpl.store() ");
       Connection conn = null;
       PreparedStatement ps = null;
       ResultSet rs = null;
       try {
      
       conn = jdbcFactory.getConnection();
       String updateString = "update customer set userid = ?, firstname = ?,lastname = ?," +"" +
       "address = ?, message = ?, salary = ? where managerid = ?";
       ps = conn.prepareStatement(updateString);
      
       ps.setInt(1,ejb.getUserID());
       ps.setString(2,ejb.getName().trim());
       ps.setString(3,ejb.getLastName().trim());
       int count = ps.executeUpdate();
       System.out.println ("Update String is " + updateString) ;
       }
       catch (Exception e ) {
       e.printStackTrace();
       }
       finally {
       try {
       ps.close();
       rs.close();
       conn.close();
       }catch (Exception e) {
       }
       }
       System.out.println (" Leaving ManagerDAOImpl.store() ");
       }
      
       public void remove(StupidDBBeanPK pk) throws javax.ejb.RemoveException, javax.ejb.EJBException {
      
       }
      
       public StupidDBBeanPK create(StupidDBBean ejb) throws javax.ejb.CreateException, javax.ejb.EJBException {
       return new StupidDBBeanPK();
       }
      
       public StupidDBBeanPK findByPrimaryKey(StupidDBBeanPK pk) throws javax.ejb.FinderException {
      
       System.out.println (" Entering ManagerDAOImpl.findByPrimaryKey() ");
       Connection conn = null;
       PreparedStatement ps = null;
       ResultSet rs = null;
       try {
       conn = jdbcFactory.getConnection();
       String queryString = "select managerid from customer where managerid = ?";
       ps = conn.prepareStatement(queryString);
       int key = pk.getUserID();
       ps.setInt(1, key);
       rs = ps.executeQuery();
       boolean result =rs .next();
       if ( result) {
       System.out.println (" Primary Key found");
       }
       }
       catch (Exception e) {
       e.printStackTrace();
       throw new FinderException("Inside ManagerDAOImpl.findbyPrimaryKey()" +
       " following primarykey " + pk.getUserID() + "notfound ");
       }
       finally {
       try {
       rs.close();
       ps.close();
       conn.close();
       }
       catch(Exception e ) {
       }
       }
       System.out.println (" Leaving ManagerDAOImpl.findByPrimaryKey() " + pk.getUserID());
       return pk;
       }
      
       public StupidDBBeanPK findByUserID(int userID) throws javax.ejb.FinderException {
      
      
       System.out.println (" Entering ManagerDAOImpl.findByUserID() ");
       Connection conn = null;
       PreparedStatement ps = null;
       ResultSet rs = null;
       StupidDBBeanPK pk = new StupidDBBeanPK() ;
      
       try {
       conn = jdbcFactory.getConnection();
       String queryString = "select managerid from manager where userid = ?";
       ps = conn.prepareStatement(queryString);
       ps.setInt (1, userID);
       rs = ps.executeQuery();
      
       boolean result =rs .next();
       if ( result) {
       pk.setUserID( rs.getInt(1) );
       System.out.println (" Primary Key found :" + pk.getUserID() );
       }
       }
       catch (Exception e) {
       e.printStackTrace();
       throw new FinderException("Inside ManagerDAOImpl.findbyPrimaryKey()" + e);
       }
       finally {
       try {
       rs.close();
       ps.close();
       conn.close();
       }
       catch(Exception e ) {
       }
       }
       System.out.println (" Leaving ManagerDAOImpl.findByUserID() with key " + pk.getUserID());
       return pk;
       }
      
      
      
      }