Uploaded image for project: 'JBoss Enterprise Application Platform'
  1. JBoss Enterprise Application Platform
  2. JBEAP-1751

<datasource-class> in <driver> is ignored

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Critical Critical
    • 7.0.0.ER4
    • 7.0.0.DR13 (Alpha)
    • JCA
    • None
    • Hide
      module add --name=pgjdbc --resources=postgresql-9.4-1203.jdbc42.jar --dependencies=javax.api,javax.transaction.api
      /subsystem=datasources/jdbc-driver=pg:add(driver-name=pg, driver-module-name=pgjdbc, driver-datasource-class-name=org.postgresql.ds.PGSimpleDataSource)
      
      batch
      /subsystem=datasources/data-source=test:add(connection-url=test, driver-name=pg, user-name=test, password=test, jndi-name=java:jboss/datasource/test)
      /subsystem=datasources/data-source=test/connection-properties=foo:add(value="bar")
      run-batch
      
      reload 
      
      /subsystem=datasources/data-source=test:test-connection-in-pool
      

      expected result is

      NoSuchMethodException: Method setFoo not found
      

      but it's

       Wrong driver class [org.postgresql.Driver] for this connection URL [test]
      
      Show
      module add --name=pgjdbc --resources=postgresql-9.4-1203.jdbc42.jar --dependencies=javax.api,javax.transaction.api /subsystem=datasources/jdbc-driver=pg:add(driver-name=pg, driver-module-name=pgjdbc, driver-datasource-class-name=org.postgresql.ds.PGSimpleDataSource) batch /subsystem=datasources/data-source=test:add(connection-url=test, driver-name=pg, user-name=test, password=test, jndi-name=java:jboss/datasource/test) /subsystem=datasources/data-source=test/connection-properties=foo:add(value="bar") run-batch reload /subsystem=datasources/data-source=test:test-connection-in-pool expected result is NoSuchMethodException: Method setFoo not found but it's Wrong driver class [org.postgresql.Driver] for this connection URL [test]

      <driver name="oracle-ucp" module="com.oracle.ucp">
          <xa-datasource-class>[class]</xa-datasource-class>
          <datasource-class>[class]</datasource-class>
      </driver>
      

      datasource-class setting is ignored and Driver class is used instead, DataSource class should have priority over Driver if defined

      <datasource-class> in <datasource> works

              jpederse@redhat.com Jesper Pedersen
              msimka@redhat.com Martin Simka
              Martin Simka Martin Simka
              Martin Simka Martin Simka
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: