0 Replies Latest reply on Jan 27, 2009 5:11 PM by Alla Petrova

    How to configure XA Datasource correctly? Getting org.jboss.

    Alla Petrova Newbie

      I am on JBoss 4.2.2 and I need to configure XA Datasource for Postgres.
      Here is exempt from my postgres-ds.xml

      <datasources>
       <xa-datasource>
       <jndi-name>DefaultDS</jndi-name>
       <connection-url>jdbc:postgresql://some_url/ecommdb</connection-url>
       <driver-class>org.postgresql.Driver</driver-class>
       <user-name>some_name</user-name>
       <password>foo</password>
      
       <!-- sql to call when connection is created -->
       <new-connection-sql>select count(*) from status</new-connection-sql>
      
       <!-- sql to call on an existing pooled connection when it is obtained from pool -->
       <check-valid-connection-sql>select count(*) from status</check-valid-connection-sql>
      
       <!-- corresponding type-mapping in the standardjbosscmp-jdbc.xml (optional) -->
       <metadata>
       <type-mapping>PostgreSQL 7.2</type-mapping>
       </metadata>
       </xa-datasource>
      ......
      </datasources>


      But when I try connecting to this database I get the following exception:

      Caused by: org.jboss.resource.JBossResourceException: Could not create connection; - nested throwable: (org.jboss.resource.JBossResourceException: No XADataSourceClass supplied!)
      at org.jboss.resource.adapter.jdbc.xa.XAManagedConnectionFactory.createManagedConnection(XAManagedConnectionFactory.java:144)
      at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.createConnectionEventListener(InternalManagedConnectionPool.java:577)
      at org.jboss.resource.connectionmanager.InternalManagedConnectionPool.getConnection(InternalManagedConnectionPool.java:262)
      at org.jboss.resource.connectionmanager.JBossManagedConnectionPool$BasePool.getConnection(JBossManagedConnectionPool.java:500)
      at org.jboss.resource.connectionmanager.BaseConnectionManager2.getManagedConnection(BaseConnectionManager2.java:341)
      at org.jboss.resource.connectionmanager.TxConnectionManager.getManagedConnection(TxConnectionManager.java:315)
      at org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateConnection(BaseConnectionManager2.java:396)
      at org.jboss.resource.connectionmanager.BaseConnectionManager2$ConnectionManagerProxy.allocateConnection(BaseConnectionManager2.java:842)
      at org.jboss.resource.adapter.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:88)
      ... 84 more


      What did I miss?
      Thanks in advance for any help you can give.