Problems with HSQLDB as a XA Datasource on Wildfly

Help
Cain
2014-08-29
2014-09-05
  • Cain

    Cain - 2014-08-29

    I'm not sure if the problem is with Wildfly for HSQLDB but Wildfly can't seem to create a connection to HSQLDB when it's configured as an XA Datasource. I keep getting a NoSuchMethodException that says "Method setURL not found". Within the application I can create an unmanaged connection no problem. As of 2.3 HSQLDB supports XA and the proper classes seem to be in the jar file. Wildfly starts up fine, but the exception occurs when a connection is being created. I undeployed my application to see if there was something wrong there, but this exception also occurs whenever I click on test connection in the management console. Here's the configuration in standalone.xml and the stack trace. Thanks in advance.

                <xa-datasource jndi-name="java:jboss/jdbc/realtime" pool-name="RealTimeDB" enabled="true" use-ccm="false">  
                    <xa-datasource-property name="URL">  
                        jdbc:hsqldb:mem:realtime;hsqldb.tx=mvcc  
                    </xa-datasource-property>  
                    <driver>hsqldb</driver>  
                    <xa-pool>  
                        <is-same-rm-override>false</is-same-rm-override>  
                        <interleaving>false</interleaving>  
                        <pad-xid>false</pad-xid>  
                        <wrap-xa-resource>false</wrap-xa-resource>  
                    </xa-pool>  
                    <security>  
                        <user-name>SA</user-name>  
                    </security>  
                    <recovery no-recovery="true"/>  
                    <validation>  
                        <validate-on-match>false</validate-on-match>  
                        <background-validation>false</background-validation>  
                    </validation>  
                    <statement>  
                        <share-prepared-statements>false</share-prepared-statements>  
                    </statement>  
                </xa-datasource>  
                <driver name="hsqldb" module="org.hsqldb">  
                    <xa-datasource-class>org.hsqldb.jdbc.pool.JDBCXADataSource</xa-datasource-class>  
                </driver>
    

    15:43:49,119 WARN [org.jboss.jca.core.connectionmanager.pool.strategy.OnePool] (XNIO-1 task-5) 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:461) [ironjacamar-jdbc-1.1.3.Final.jar:1.1.3.Final]
    at org.jboss.jca.adapters.jdbc.xa.XAManagedConnectionFactory.createManagedConnection(XAManagedConnectionFactory.java:398) [ironjacamar-jdbc-1.1.3.Final.jar:1.1.3.Final]
    at org.jboss.jca.core.connectionmanager.pool.mcp.SemaphoreArrayListManagedConnectionPool.createConnectionEventListener(SemaphoreArrayListManagedConnectionPool.java:1144) [ironjacamar-core-impl-1.1.3.Final.jar:1.1.3.Final]
    at org.jboss.jca.core.connectionmanager.pool.mcp.SemaphoreArrayListManagedConnectionPool.getConnection(SemaphoreArrayListManagedConnectionPool.java:446) [ironjacamar-core-impl-1.1.3.Final.jar:1.1.3.Final]
    at org.jboss.jca.core.connectionmanager.pool.AbstractPool.internalTestConnection(AbstractPool.java:747) [ironjacamar-core-impl-1.1.3.Final.jar:1.1.3.Final]
    at org.jboss.jca.core.connectionmanager.pool.strategy.OnePool.testConnection(OnePool.java:91) [ironjacamar-core-impl-1.1.3.Final.jar:1.1.3.Final]
    at org.jboss.as.connector.subsystems.common.pool.PoolOperations$TestConnectionInPool.invokeCommandOn(PoolOperations.java:206) [wildfly-connector-8.0.0.Final.jar:8.0.0.Final]
    at org.jboss.as.connector.subsystems.common.pool.PoolOperations$1.execute(PoolOperations.java:87) [wildfly-connector-8.0.0.Final.jar:8.0.0.Final]
    at org.jboss.as.controller.AbstractOperationContext.executeStep(AbstractOperationContext.java:591) [wildfly-controller-8.0.0.Final.jar:8.0.0.Final]
    at org.jboss.as.controller.AbstractOperationContext.doCompleteStep(AbstractOperationContext.java:469) [wildfly-controller-8.0.0.Final.jar:8.0.0.Final]
    at org.jboss.as.controller.AbstractOperationContext.completeStepInternal(AbstractOperationContext.java:273) [wildfly-controller-8.0.0.Final.jar:8.0.0.Final]
    at org.jboss.as.controller.AbstractOperationContext.executeOperation(AbstractOperationContext.java:268) [wildfly-controller-8.0.0.Final.jar:8.0.0.Final]
    at org.jboss.as.controller.ModelControllerImpl.internalExecute(ModelControllerImpl.java:272) [wildfly-controller-8.0.0.Final.jar:8.0.0.Final]
    at org.jboss.as.controller.ModelControllerImpl.execute(ModelControllerImpl.java:146) [wildfly-controller-8.0.0.Final.jar:8.0.0.Final]
    at org.jboss.as.domain.http.server.DomainApiHandler.handleRequest(DomainApiHandler.java:169)
    at org.jboss.as.domain.http.server.security.SubjectDoAsHandler$1.run(SubjectDoAsHandler.java:72)
    at org.jboss.as.domain.http.server.security.SubjectDoAsHandler$1.run(SubjectDoAsHandler.java:68)
    at java.security.AccessController.doPrivileged(Native Method) [rt.jar:1.7.0_65]
    at javax.security.auth.Subject.doAs(Subject.java:415) [rt.jar:1.7.0_65]
    at org.jboss.as.controller.AccessAuditContext.doAs(AccessAuditContext.java:94) [wildfly-controller-8.0.0.Final.jar:8.0.0.Final]
    at org.jboss.as.domain.http.server.security.SubjectDoAsHandler.handleRequest(SubjectDoAsHandler.java:68)
    at org.jboss.as.domain.http.server.security.SubjectDoAsHandler.handleRequest(SubjectDoAsHandler.java:63)
    at io.undertow.server.handlers.BlockingHandler.handleRequest(BlockingHandler.java:50)
    at org.jboss.as.domain.http.server.DomainApiCheckHandler.handleRequest(DomainApiCheckHandler.java:77)
    at io.undertow.security.handlers.AuthenticationCallHandler.handleRequest(AuthenticationCallHandler.java:52)
    at io.undertow.server.Connectors.executeRootHandler(Connectors.java:168)
    at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:687)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_65]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_65]
    at java.lang.Thread.run(Thread.java:745) [rt.jar:1.7.0_65]
    Caused by: javax.resource.ResourceException: Could not find accessor on XADataSource:
    at org.jboss.jca.adapters.jdbc.xa.XAManagedConnectionFactory.getXADataSource(XAManagedConnectionFactory.java:616) [ironjacamar-jdbc-1.1.3.Final.jar:1.1.3.Final]
    at org.jboss.jca.adapters.jdbc.xa.XAManagedConnectionFactory.getXAManagedConnection(XAManagedConnectionFactory.java:444) [ironjacamar-jdbc-1.1.3.Final.jar:1.1.3.Final]
    ... 29 more
    Caused by: java.lang.NoSuchMethodException: Method setURL not found
    at org.jboss.jca.adapters.jdbc.util.Injection.inject(Injection.java:141) [ironjacamar-jdbc-1.1.3.Final.jar:1.1.3.Final]
    at org.jboss.jca.adapters.jdbc.util.Injection.inject(Injection.java:70) [ironjacamar-jdbc-1.1.3.Final.jar:1.1.3.Final]
    at org.jboss.jca.adapters.jdbc.xa.XAManagedConnectionFactory.getXADataSource(XAManagedConnectionFactory.java:591) [ironjacamar-jdbc-1.1.3.Final.jar:1.1.3.Final]
    ... 30 more

     
  • Cain

    Cain - 2014-08-29

    Turns out that <xa-datasource-property name="URL"> should be <xa-datasource-property name="Url">. Now that I'm past that I'm having another error. I assume it's trying to connect to the database but doesn't have the right credentials. Not sure why that would be the case because I specified sa as the user and left the password blank. I tried setting a user and password in the connection url and using that, but that doesn't seem to help.

    ko13:00:12,729 WARN [org.jboss.jca.core.connectionmanager.pool.strategy.OnePool] (XNIO-1 task-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:461) [ironjacamar-jdbc-1.1.3.Final.jar:1.1.3.Final]
    at org.jboss.jca.adapters.jdbc.xa.XAManagedConnectionFactory.createManagedConnection(XAManagedConnectionFactory.java:398) [ironjacamar-jdbc-1.1.3.Final.jar:1.1.3.Final]
    at org.jboss.jca.core.connectionmanager.pool.mcp.SemaphoreArrayListManagedConnectionPool.createConnectionEventListener(SemaphoreArrayListManagedConnectionPool.java:1144) [ironjacamar-core-impl-1.1.3.Final.jar:1.1.3.Final]
    at org.jboss.jca.core.connectionmanager.pool.mcp.SemaphoreArrayListManagedConnectionPool.getConnection(SemaphoreArrayListManagedConnectionPool.java:446) [ironjacamar-core-impl-1.1.3.Final.jar:1.1.3.Final]
    at org.jboss.jca.core.connectionmanager.pool.AbstractPool.internalTestConnection(AbstractPool.java:747) [ironjacamar-core-impl-1.1.3.Final.jar:1.1.3.Final]
    at org.jboss.jca.core.connectionmanager.pool.strategy.OnePool.testConnection(OnePool.java:91) [ironjacamar-core-impl-1.1.3.Final.jar:1.1.3.Final]
    at org.jboss.as.connector.subsystems.common.pool.PoolOperations$TestConnectionInPool.invokeCommandOn(PoolOperations.java:206) [wildfly-connector-8.0.0.Final.jar:8.0.0.Final]
    at org.jboss.as.connector.subsystems.common.pool.PoolOperations$1.execute(PoolOperations.java:87) [wildfly-connector-8.0.0.Final.jar:8.0.0.Final]
    at org.jboss.as.controller.AbstractOperationContext.executeStep(AbstractOperationContext.java:591) [wildfly-controller-8.0.0.Final.jar:8.0.0.Final]
    at org.jboss.as.controller.AbstractOperationContext.doCompleteStep(AbstractOperationContext.java:469) [wildfly-controller-8.0.0.Final.jar:8.0.0.Final]
    at org.jboss.as.controller.AbstractOperationContext.completeStepInternal(AbstractOperationContext.java:273) [wildfly-controller-8.0.0.Final.jar:8.0.0.Final]
    at org.jboss.as.controller.AbstractOperationContext.executeOperation(AbstractOperationContext.java:268) [wildfly-controller-8.0.0.Final.jar:8.0.0.Final]
    at org.jboss.as.controller.ModelControllerImpl.internalExecute(ModelControllerImpl.java:272) [wildfly-controller-8.0.0.Final.jar:8.0.0.Final]
    at org.jboss.as.controller.ModelControllerImpl.execute(ModelControllerImpl.java:146) [wildfly-controller-8.0.0.Final.jar:8.0.0.Final]
    at org.jboss.as.domain.http.server.DomainApiHandler.handleRequest(DomainApiHandler.java:169)
    at org.jboss.as.domain.http.server.security.SubjectDoAsHandler$1.run(SubjectDoAsHandler.java:72)
    at org.jboss.as.domain.http.server.security.SubjectDoAsHandler$1.run(SubjectDoAsHandler.java:68)
    at java.security.AccessController.doPrivileged(Native Method) [rt.jar:1.7.0_65]
    at javax.security.auth.Subject.doAs(Subject.java:415) [rt.jar:1.7.0_65]
    at org.jboss.as.controller.AccessAuditContext.doAs(AccessAuditContext.java:94) [wildfly-controller-8.0.0.Final.jar:8.0.0.Final]
    at org.jboss.as.domain.http.server.security.SubjectDoAsHandler.handleRequest(SubjectDoAsHandler.java:68)
    at org.jboss.as.domain.http.server.security.SubjectDoAsHandler.handleRequest(SubjectDoAsHandler.java:63)
    at io.undertow.server.handlers.BlockingHandler.handleRequest(BlockingHandler.java:50)
    at org.jboss.as.domain.http.server.DomainApiCheckHandler.handleRequest(DomainApiCheckHandler.java:77)
    at io.undertow.security.handlers.AuthenticationCallHandler.handleRequest(AuthenticationCallHandler.java:52)
    at io.undertow.server.Connectors.executeRootHandler(Connectors.java:168)
    at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:687)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_65]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_65]
    at java.lang.Thread.run(Thread.java:745) [rt.jar:1.7.0_65]
    Caused by: java.sql.SQLInvalidAuthorizationSpecException: invalid authorization specification
    at org.hsqldb.jdbc.JDBCUtil.sqlException(Unknown Source)
    at org.hsqldb.jdbc.JDBCUtil.sqlException(Unknown Source)
    at org.hsqldb.jdbc.pool.JDBCXADataSource.getXAConnection(Unknown Source)
    at org.jboss.jca.adapters.jdbc.xa.XAManagedConnectionFactory.getXAManagedConnection(XAManagedConnectionFactory.java:444) [ironjacamar-jdbc-1.1.3.Final.jar:1.1.3.Final]
    ... 29 more
    Caused by: org.hsqldb.HsqlException: invalid authorization specification
    at org.hsqldb.error.Error.error(Unknown Source)
    at org.hsqldb.error.Error.error(Unknown Source)
    ... 31 more

     
    Last edit: Cain 2014-08-29
  • Fred Toussi

    Fred Toussi - 2014-08-31

    I don't know which calls it is using. Try setting a password field, and if necessary adding <user>SA</user> as well.

                <security>  
                    <user-name>SA</user-name>  
                    <password></password>  
                </security>
    
     
  • Cain

    Cain - 2014-09-05

    I managed to get it working. I had to set a user and password in three places for it to work.

                    <xa-datasource-property name="Url">
                        jdbc:hsqldb:mem:realtime;hsqldb.tx=mvcc;user=realtime;password=password
                    </xa-datasource-property>
                    <xa-datasource-property name="User">
                        realtime
                    </xa-datasource-property>
                    <xa-datasource-property name="Password">
                        password
                    </xa-datasource-property>
                    <security>
                        <user-name>realtime</user-name>
                        <password>password</password>
                    </security>
    
     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks