2 Replies Latest reply: Mar 16, 2012 7:52 AM by Marcel Šebek RSS

XA datasource for non-module jdbc drivers

Marcel Šebek Newbie

I was unable to create an XA postgresql datasource. At first I've deployed the driver:

 

12:52:38,489 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-1) JBAS015876: Starting deployment of "postgresql-9.1-901.jdbc4.jar"

12:52:38,529 INFO  [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-3) JBAS010404: Deploying non-JDBC-compliant driver class org.postgresql.Driver (version 9.1)

12:52:38,539 INFO  [org.jboss.as.server] (DeploymentScanner-threads - 2) JBAS018559: Deployed "postgresql-9.1-901.jdbc4.jar"

 

Then I've created a datasource using the web admin console:

 

13:00:46,278 INFO  [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-1) JBAS010400: Bound data source [java:/jdbc/pgxa]

 

I've specified the following xa properties: DatabaseName, PortNumber, ServerName. Then I've enabled the datasource and hit "Test connection" that caused the exception:

 

13:02:52,047 WARN  [org.jboss.jca.core.connectionmanager.pool.strategy.OnePool] (HttpManagementService-threads - 3) IJ000604: Throwable while attempting to get a new connection: null: javax.resource.ResourceException: Could not create connection

        at org.jboss.jca.adapters.jdbc.xa.XAManagedConnectionFactory.getXAManagedConnection(XAManagedConnectionFactory.java:447) [ironjacamar-jdbc-1.0.7.Final.jar:1.0.7.Final]

        at org.jboss.jca.adapters.jdbc.xa.XAManagedConnectionFactory.createManagedConnection(XAManagedConnectionFactory.java:385) [ironjacamar-jdbc-1.0.7.Final.jar:1.0.7.Final]

        at org.jboss.jca.core.connectionmanager.pool.mcp.SemaphoreArrayListManagedConnectionPool.createConnectionEventListener(SemaphoreArrayListManagedConnectionPool.java:758) [ironjacamar-core-impl-1.0.7.Final.jar:1.0.7.Final]

        at org.jboss.jca.core.connectionmanager.pool.mcp.SemaphoreArrayListManagedConnectionPool.getConnection(SemaphoreArrayListManagedConnectionPool.java:343) [ironjacamar-core-impl-1.0.7.Final.jar:1.0.7.Final]

        at org.jboss.jca.core.connectionmanager.pool.AbstractPool.getSimpleConnection(AbstractPool.java:400) [ironjacamar-core-impl-1.0.7.Final.jar:1.0.7.Final]

        at org.jboss.jca.core.connectionmanager.pool.AbstractPool.getConnection(AbstractPool.java:365) [ironjacamar-core-impl-1.0.7.Final.jar:1.0.7.Final]

        at org.jboss.jca.core.connectionmanager.pool.AbstractPool.internalTestConnection(AbstractPool.java:630) [ironjacamar-core-impl-1.0.7.Final.jar:1.0.7.Final]

        at org.jboss.jca.core.connectionmanager.pool.strategy.OnePool.testConnection(OnePool.java:88) [ironjacamar-core-impl-1.0.7.Final.jar:1.0.7.Final]

        at org.jboss.as.connector.pool.PoolOperations$TestConnectionInPool.invokeCommandOn(PoolOperations.java:120) [jboss-as-connector-7.1.0.Final.jar:7.1.0.Final]

        at org.jboss.as.connector.pool.PoolOperations$1.execute(PoolOperations.java:59) [jboss-as-connector-7.1.0.Final.jar:7.1.0.Final]

        at org.jboss.as.controller.AbstractOperationContext.executeStep(AbstractOperationContext.java:387) [jboss-as-controller-7.1.0.Final.jar:7.1.0.Final]

        at org.jboss.as.controller.AbstractOperationContext.doCompleteStep(AbstractOperationContext.java:274) [jboss-as-controller-7.1.0.Final.jar:7.1.0.Final]

        at org.jboss.as.controller.AbstractOperationContext.completeStep(AbstractOperationContext.java:202) [jboss-as-controller-7.1.0.Final.jar:7.1.0.Final]

        at org.jboss.as.connector.pool.PoolOperations.execute(PoolOperations.java:73) [jboss-as-connector-7.1.0.Final.jar:7.1.0.Final]

        at org.jboss.as.controller.AbstractOperationContext.executeStep(AbstractOperationContext.java:387) [jboss-as-controller-7.1.0.Final.jar:7.1.0.Final]

        at org.jboss.as.controller.AbstractOperationContext.doCompleteStep(AbstractOperationContext.java:274) [jboss-as-controller-7.1.0.Final.jar:7.1.0.Final]

        at org.jboss.as.controller.AbstractOperationContext.completeStep(AbstractOperationContext.java:202) [jboss-as-controller-7.1.0.Final.jar:7.1.0.Final]

        at org.jboss.as.controller.ModelControllerImpl$DefaultPrepareStepHandler.execute(ModelControllerImpl.java:461) [jboss-as-controller-7.1.0.Final.jar:7.1.0.Final]

        at org.jboss.as.controller.AbstractOperationContext.executeStep(AbstractOperationContext.java:387) [jboss-as-controller-7.1.0.Final.jar:7.1.0.Final]

        at org.jboss.as.controller.AbstractOperationContext.doCompleteStep(AbstractOperationContext.java:274) [jboss-as-controller-7.1.0.Final.jar:7.1.0.Final]

        at org.jboss.as.controller.AbstractOperationContext.completeStep(AbstractOperationContext.java:202) [jboss-as-controller-7.1.0.Final.jar:7.1.0.Final]

        at org.jboss.as.controller.ModelControllerImpl.execute(ModelControllerImpl.java:121) [jboss-as-controller-7.1.0.Final.jar:7.1.0.Final]

        at org.jboss.as.controller.ModelControllerImpl$1.execute(ModelControllerImpl.java:304) [jboss-as-controller-7.1.0.Final.jar:7.1.0.Final]

        at org.jboss.as.controller.ModelControllerImpl$1.execute(ModelControllerImpl.java:294) [jboss-as-controller-7.1.0.Final.jar:7.1.0.Final]

        at org.jboss.as.domain.http.server.DomainApiHandler.processRequest(DomainApiHandler.java:294)

        at org.jboss.as.domain.http.server.DomainApiHandler.doHandle(DomainApiHandler.java:201)

        at org.jboss.as.domain.http.server.DomainApiHandler.handle(DomainApiHandler.java:208)

        at org.jboss.as.domain.http.server.security.SubjectAssociationHandler.handle(SubjectAssociationHandler.java:51)

        at org.jboss.com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:78)

        at org.jboss.sun.net.httpserver.AuthFilter.doFilter(AuthFilter.java:69)

        at org.jboss.com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:81)

        at org.jboss.sun.net.httpserver.ServerImpl$Exchange$LinkHandler.handle(ServerImpl.java:710)

        at org.jboss.com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:78)

        at org.jboss.as.domain.http.server.RealmReadinessFilter.doFilter(RealmReadinessFilter.java:54)

        at org.jboss.com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:81)

        at org.jboss.sun.net.httpserver.ServerImpl$Exchange.run(ServerImpl.java:682)

        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [rt.jar:1.6.0_26]

        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [rt.jar:1.6.0_26]

        at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_26]

        at org.jboss.threads.JBossThread.run(JBossThread.java:122) [jboss-threads-2.0.0.GA.jar:2.0.0.GA]

Caused by: javax.resource.ResourceException: No XADataSourceClass supplied!

        at org.jboss.jca.adapters.jdbc.xa.XAManagedConnectionFactory.getXADataSource(XAManagedConnectionFactory.java:547) [ironjacamar-jdbc-1.0.7.Final.jar:1.0.7.Final]

        at org.jboss.jca.adapters.jdbc.xa.XAManagedConnectionFactory.getXAManagedConnection(XAManagedConnectionFactory.java:430) [ironjacamar-jdbc-1.0.7.Final.jar:1.0.7.Final]

        ... 39 more

 

I've tried to pass XADataSourceClass as a XA property but with no success. When installing the jdbc driver as a module, one has to specify this class inside jboss configuration file but when the driver is deployed as an "application", the XADataSourceClass value should probably be detected somehow. Should I report this as a jboss bug or is that a problem in the jdbc driver?