Uploaded image for project: 'Thorntail'
  1. Thorntail
  2. THORN-1215

EAP quickstart jta-crash-rec: javax.resource.ResourceException: IJ031101: XADataSourceClass is undefined

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: None
    • Fix Version/s: 2017.4.0
    • Component/s: None
    • Labels:
      None

      Description

      I'm trying to get the EAP quickstart jta-crash-rec to start with Swarm, like this:

      1. git clone -b 7.0.x https://github.com/jboss-developer/jboss-eap-quickstarts.git
      2. cd jboss-eap-quickstarts/jta-crash-rec
      3. mvn clean package
      4. wget https://repo1.maven.org/maven2/org/wildfly/swarm/swarmtool/2017.3.3/swarmtool-2017.3.3-standalone.jar
      5. java -jar swarmtool-2017.3.3-standalone.jar -d com.h2database:h2:1.4.193 target/jboss-jta-crash-rec.war
      6. java -jar jboss-jta-crash-rec-swarm.jar

      The uberjar fails to boot (actually fails to deploy the application) with a bunch of errors. The first one, which is the only one important, reads:

      2017-03-16 13:53:30,141 WARN  [org.jboss.jca.core.connectionmanager.pool.strategy.OnePool] (ServerService Thread Pool -- 11) IJ000604: Throwable while attempting to get a new connection: null: javax.resource.ResourceException: IJ031084: Unable to create connection
              at org.jboss.jca.adapters.jdbc.xa.XAManagedConnectionFactory.getXAManagedConnection(XAManagedConnectionFactory.java:509)
              at org.jboss.jca.adapters.jdbc.xa.XAManagedConnectionFactory.createManagedConnection(XAManagedConnectionFactory.java:416)
              at org.jboss.jca.core.connectionmanager.pool.mcp.SemaphoreConcurrentLinkedDequeManagedConnectionPool.createConnectionEventListener(SemaphoreConcurrentLinkedDequeManagedConnectionPool.java:1320)
              ...
      Caused by: javax.resource.ResourceException: IJ031101: XADataSourceClass is undefined
              at org.jboss.jca.adapters.jdbc.xa.XAManagedConnectionFactory.getXADataSource(XAManagedConnectionFactory.java:621)
              at org.jboss.jca.adapters.jdbc.xa.XAManagedConnectionFactory.getXAManagedConnection(XAManagedConnectionFactory.java:492)
              ... 35 more
      

      Looking at XAManagedConnectionFactory.getXADataSource, this actually means that the name of the XA datasource class isn't configured. However, the uberjar boot logs clearly shows that the H2 JDBC driver was autodetected, and Swarm's H2DriverInfo clearly has:

          protected void configureDriver(JDBCDriver driver) {
              driver.xaDatasourceClass("org.h2.jdbcx.JdbcDataSource");
          }
      

      So this should work, but doesn't. I'm looking at the EAP documentation that has instructions how to create datasources and JDBC drivers: https://access.redhat.com/documentation/en-us/red_hat_jboss_enterprise_application_platform/7.0/html/configuration_guide/datasource_management#example_datasource_configurations

      There, they don't use the xa-datasource-class mgmt attribute, they only use driver-xa-datasource-class-name. I tried to register a JDBC driver with both attributes and the xa-datasource-class one isn't even persisted to standalone.xml; instead, what get's persisted as the <xa-datasource-class> XML element is the driver-xa-datasource-class-name mgmt attribute. This is clearly a WildFly mgmt model usability bug.

      I tried to change H2DriverInfo to call driver.driverXaDatasourceClassName("org.h2.jdbcx.JdbcDataSource"); instead and the quickstart uberjar starts just fine.

      To me, this sounds like we're registering JDBC drivers using wrong mgmt attribute, but for some reason, it seems work just fine in non-XA scenarios? I'm no expert on the datasources subsystem, so CCing Stefano Maestri.

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                bob.mcwhirter Bob McWhirter
                Reporter:
                lthon Ladislav Thon
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: