0 Replies Latest reply on Dec 1, 2004 2:02 AM by Rahul Kulkarni

    Error Could not Enlist XA Resource ! Need help

    Rahul Kulkarni Newbie

      Hi Friends
      I am using oracle10g with jboss3.2.1 I have stateless session bean with a method with requires container managed transaction
      when in the method i try to get a db connection i get following exception
      "[TxConnectionManager$TxConnectionEventListener] Could not enlist XAResource!
      javax.transaction.RollbackException: Already marked for rollback
      at org.jboss.tm.TransactionImpl.enlistResource(TransactionImpl.java:576)
      at org.jboss.resource.connectionmanager.TxConnectionManager$TxConnectionEventListener.enlist(TxConnectionManager.java:460)
      at org.jboss.resource.connectionmanager.TxConnectionManager.managedConnectionReconnected(TxConnectionManager.java:358)
      at org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateConnection(BaseConnectionManager2.java:490)
      at org.jboss.resource.connectionmanager.BaseConnectionManager2$ConnectionManagerProxy.allocateConnection(BaseConnectionManager2.java:798)
      at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:122)
      at com.passkey.core.util.ServiceLocator.getDBConnection(ServiceLocator.java:197)
      at com.passkey.rlm.dao.sql.SQLRLMBridgeDAO.isCardAccepted(SQLRLMBridgeDAO.java:4045)
      at com.passkey.rlm.business.RLMBridgeBO.isCardAccepted(RLMBridgeBO.java:2224)
      at com.passkey.rlm.business.ejb.RLMReservationEJB.validateBusinessRules(RLMReservationEJB.java:154)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:629)
      at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:186)
      at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:72)
      at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:84)
      at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:296)
      at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:104)
      at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:117)
      at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:191)
      at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:122)
      at org.jboss.ejb.StatelessSessionContainer.internalInvoke(StatelessSessionContainer.java:322)
      at org.jboss.ejb.Container.invoke(Container.java:674)
      at org.jboss.ejb.plugins.local.BaseLocalProxyFactory.invoke(BaseLocalProxyFactory.java:353)
      at org.jboss.ejb.plugins.local.StatelessSessionProxy.invoke(StatelessSessionProxy.java:83)
      at $Proxy65.validateBusinessRules(Unknown Source)
      at com.passkey.rlm.business.RLMBridgeBO.bookReservation(RLMBridgeBO.java:1865)
      at com.passkey.rlm.facade.RLMFacade.bookReservation(RLMFacade.java:884)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:629)
      at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:186)
      at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:72)
      at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:84)
      at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:243)
      at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:104)
      at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:117)
      at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:191)
      at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:122)
      at org.jboss.ejb.StatelessSessionContainer.internalInvoke(StatelessSessionContainer.java:322)
      at org.jboss.ejb.Container.invoke(Container.java:674)
      at org.jboss.ejb.plugins.local.BaseLocalProxyFactory.invoke(BaseLocalProxyFactory.java:353)
      at org.jboss.ejb.plugins.local.StatelessSessionProxy.invoke(StatelessSessionProxy.java:83)
      at $Proxy63.bookReservation(Unknown Source)
      at com.passkey.rlm.web.delegate.RLMDelegate.bookReservation(RLMDelegate.java:1053)
      at com.passkey.rlm.web.action.ProgressSummaryActionThread.run(ProgressSummaryActionThread.java:73)
      12:28:50,556 INFO [TxConnectionManager] Could not enlist in transaction on entering meta-aware object!
      javax.transaction.SystemException: Could not enlist XAResource!javax.transaction.RollbackException: Already marked for rollback
      at org.jboss.resource.connectionmanager.TxConnectionManager$TxConnectionEventListener.enlist(TxConnectionManager.java:469)
      at org.jboss.resource.connectionmanager.TxConnectionManager.managedConnectionReconnected(TxConnectionManager.java:358)
      at org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateConnection(BaseConnectionManager2.java:490)
      at org.jboss.resource.connectionmanager.BaseConnectionManager2$ConnectionManagerProxy.allocateConnection(BaseConnectionManager2.java:798)
      at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:122)
      at com.passkey.core.util.ServiceLocator.getDBConnection(ServiceLocator.java:197)
      at com.passkey.rlm.dao.sql.SQLRLMBridgeDAO.isCardAccepted(SQLRLMBridgeDAO.java:4045)
      at com.passkey.rlm.business.RLMBridgeBO.isCardAccepted(RLMBridgeBO.java:2224)
      at com.passkey.rlm.business.ejb.RLMReservationEJB.validateBusinessRules(RLMReservationEJB.java:154)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:629)
      at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:186)
      at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:72)
      at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:84)
      at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:296)
      at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:104)
      at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:117)
      at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:191)
      at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:122)
      at org.jboss.ejb.StatelessSessionContainer.internalInvoke(StatelessSessionContainer.java:322)
      at org.jboss.ejb.Container.invoke(Container.java:674)"

      My oracle-ds.xml is

      <local-tx-datasource>
      <jndi-name>OracleDS</jndi-name>
      <track-connection-by-tx>false</track-connection-by-tx>
      <connection-url>jdbc:oracle:thin:@192.168.67.66:1521:oradb10g</connection-url>
      <driver-class>oracle.jdbc.driver.OracleDriver</driver-class>
      <user-name></user-name>

      <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter</exception-sorter-class-name>
      <min-pool-size>20</min-pool-size>
      <max-pool-size>150</max-pool-size>
      <application-managed-security/>
      <blocking-timeout-millis>30000</blocking-timeout-millis>
      <track-statements>false</track-statements>

      true

      <application-managed-security/>
      </local-tx-datasource>


      and oracle-xa-ds.xml is

      <xa-datasource>
      <jndi-name>XAOracleDS</jndi-name>
      <track-connection-by-tx>true</track-connection-by-tx>
      <isSameRM-override-value>false</isSameRM-override-value>
      <xa-datasource-class>oracle.jdbc.xa.client.OracleXADataSource</xa-datasource-class>
      <xa-datasource-property name="URL">jdbc:oracle:thin:@192.168.67.66:1521:oradb10g</xa-datasource-property>
      <xa-datasource-property name="User"></xa-datasource-property>
      <xa-datasource-property name="Password"></xa-datasource-property>
      <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter</exception-sorter-class-name>
      <min-pool-size>20</min-pool-size>
      <max-pool-size>150</max-pool-size>
      <blocking-timeout-millis>30000</blocking-timeout-millis>
      <track-statements>true</track-statements>
      <no-tx-separate-pools/>
      <application-managed-security/>
      </xa-datasource>
      <!--

      <depends optional-attribute-name="TransactionManagerService">jboss:service=TransactionManager

      -->


      My ejb-jar.xml partly looks like

      <container-transaction>

      <ejb-name>RLMReservationEJB</ejb-name>
      <method-name>*</method-name>

      <trans-attribute>RequiresNew</trans-attribute>
      </container-transaction>

      Help is needed urgently
      Thanks in advance