1 2 3 Previous Next 32 Replies Latest reply on Jul 22, 2009 12:54 PM by Jonathan Halliday

    Problem configuring Oracle for XA Recovery

    Andrew Bonfield Newbie

      I have been trying to configure JBoss 4.2.2GA to get XA recovery to work.
      I have looked at the documentation but I am still struggling.

      I want to be able to configure an database connection that automatically enlists and recovers.
      What is the recommended way of doing this?

      Having read the documentation that says:

      Note: if using the transactional JDBC 2.0 driver provided with JBossJTA, then
      no additional work is necessary in order to ensure that recovery occurs.

      I then set the following datasource properties


      <local-tx-datasource>
      <jndi-name>TCConfigDB</jndi-name>
      <connection-url>jdbc:arjuna:jdbc:oracle:thin:@localhost:1521:ORCL9i</connection-url>
      <driver-class>com.arjuna.ats.jdbc.TransactionalDriver</driver-class>
      <connection-property name="DYNAMIC_CLASS">oracle.jdbc.OracleDriver</connection-property>
      <user-name>username</user-name>
      password
      </local-tx-datasource>

      this lead to the following error on start up:


      15:24:44,660 WARN [logger] [com.arjuna.ats.internal.jdbc.nojdbc3] Can't load JDBC 3.0 wrapper, falling back to JDBC 2.0: java.util.Hashtable$EmptyEnumerator@de
      a70b
      15:24:44,676 ERROR [STDERR] java.lang.ClassCastException: oracle.jdbc.OracleDriver
      15:24:44,676 ERROR [STDERR] at com.arjuna.ats.internal.jdbc.DirectRecoverableConnection.createConnection(DirectRecoverableConnection.java:393)
      15:24:44,676 ERROR [STDERR] at com.arjuna.ats.internal.jdbc.DirectRecoverableConnection.getConnection(DirectRecoverableConnection.java:301)
      15:24:44,676 ERROR [STDERR] at com.arjuna.ats.internal.jdbc.ConnectionImple.getConnection(ConnectionImple.java:584)
      15:24:44,676 ERROR [STDERR] at com.arjuna.ats.internal.jdbc.ConnectionImple.getTransactionIsolation(ConnectionImple.java:448)
      15:24:44,676 ERROR [STDERR] at org.jboss.resource.adapter.jdbc.BaseWrapperManagedConnection.(BaseWrapperManagedConnection.java:98)
      15:24:44,676 ERROR [STDERR] at org.jboss.resource.adapter.jdbc.local.LocalManagedConnection.(LocalManagedConnection.java:47)
      15:24:44,676 ERROR [STDERR] at org.jboss.resource.adapter.jdbc.local.LocalManagedConnectionFactory.createManagedConnection(LocalManagedConnectionFactory.java:175)
      15:24:44,676 ERROR [STDERR] at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.createConnectionEventListener(InternalManagedConnectionPool.java:577)
      15:24:44,676 ERROR [STDERR] at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.getConnection(InternalManagedConnectionPool.java:262)
      15:24:44,676 ERROR [STDERR] at org.jboss.resource.connectionmanager.JBossManagedConnectionPool$BasePool.getConnection(JBossManagedConnectionPool.java:500)
      15:24:44,676 ERROR [STDERR] at org.jboss.resource.connectionmanager.BaseConnectionManager2.getManagedConnection(BaseConnectionManager2.java:341)
      15:24:44,676 ERROR [STDERR] at org.jboss.resource.connectionmanager.TxConnectionManager.getManagedConnection(TxConnectionManager.java:315)
      15:24:44,676 ERROR [STDERR] at org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateConnection(BaseConnectionManager2.java:396)
      15:24:44,676 ERROR [STDERR] at org.jboss.resource.connectionmanager.BaseConnectionManager2$ConnectionManagerProxy.allocateConnection(BaseConnectionManager2.java:842)
      15:24:44,676 ERROR [STDERR] at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:88)


      Debugging the code this is because it is being cast to a DynamicClass.




      Previously I had also tried modifying jbossjta-properties.xml to use the JDBCXARecovery class.





      .......

      but this also led to a ClassCastException, where the JBoss wrapper datasource failed to be cast to XADataSource
      Classcast at JDBCXARecovery line 174

      The solution needs to be able to work with Oracle and also with other databases, which is why I have stayed clear of the OracleXARecovery class.


      Please could someone enlighten me regarding the recommended way of doing this (including a configuration example please!)


      Thanks in advance


      Andrew

        1 2 3 Previous Next