2 Replies Latest reply on Mar 25, 2015 10:29 AM by gaol

    JDBC driver module-slot is not persisted in domain mode

    gaol

      The module-slot of jdbc-driver is NOT persisted in domain mode, but it is persisted in standalone mode.

       

      I tested using latest local build of WilfFly (using wildfly-core Beta1). (latest WildFly commit id: d4c0174faa914e59f92dc1d097b14284154ee78c)

       

      Java Version:

      lgao /sources/wildfly/build/target/wildfly-9.0.0.Alpha2-SNAPSHOT $ java -version
      java version "1.8.0_05"
      Java(TM) SE Runtime Environment (build 1.8.0_05-b13)
      Java HotSpot(TM) 64-Bit Server VM (build 25.5-b02, mixed mode)
      

       

      I have a jdbc-driver jboss-module defined in non-default slot:

       

      <?xml version="1.0" encoding="UTF-8"?>
      
      
      <module xmlns="urn:jboss:module:1.1" name="org.postgresql" slot="9.3">
          <resources>
              <resource-root path="postgresql-9.3-1103-jdbc4.jar"/>
          </resources>
          <dependencies>
              <module name="javax.api"/>
              <module name="javax.transaction.api"/>
          </dependencies>
      </module>
      
      

       

      Then I tried to configure the jdbc-driver using CLI in domain mode:

      [domain@localhost:9990 /] /profile=full/subsystem=datasources/jdbc-driver=postgresql-93:add(driver-name=postgresql-93,driver-module-name=org.postgresql,module-slot=9.3)
      {
          "outcome" => "success",
          "result" => undefined,
          "server-groups" => {"main-server-group" => {"host" => {"master" => {
              "server-one" => {"response" => {"outcome" => "success"}},
              "server-two" => {"response" => {"outcome" => "success"}}
          }}}}
      }
      
      

       

      Although the command executes successfully, the module-slot information is missing in domain.xml:

      <driver name="postgresql-93" module="org.postgresql"/>
      
      

       

      It is supposed to be:

      <driver name="postgresql-93" module="org.postgresql:9.3"/>
      
      

       

      I can still read the slot information using command:

      [domain@localhost:9990 /] /profile=full/subsystem=datasources/jdbc-driver=postgresql-93:read-resource
      {
          "outcome" => "success",
          "result" => {
              "deployment-name" => undefined,
              "driver-class-name" => undefined,
              "driver-datasource-class-name" => undefined,
              "driver-major-version" => undefined,
              "driver-minor-version" => undefined,
              "driver-module-name" => "org.postgresql",
              "driver-name" => "postgresql-93",
              "driver-xa-datasource-class-name" => undefined,
              "jdbc-compliant" => undefined,
              "module-slot" => "9.3",
              "profile" => undefined,
              "xa-datasource-class" => undefined
          }
      }
      
      


      but I can not read the slot the information anymore after restart the server(domain mode):

      [domain@localhost:9990 /] /profile=full/subsystem=datasources/jdbc-driver=postgresql-93:read-resource
      {
          "outcome" => "success",
          "result" => {
              "deployment-name" => undefined,
              "driver-class-name" => undefined,
              "driver-datasource-class-name" => undefined,
              "driver-major-version" => undefined,
              "driver-minor-version" => undefined,
              "driver-module-name" => "org.postgresql",
              "driver-name" => "postgresql-93",
              "driver-xa-datasource-class-name" => undefined,
              "jdbc-compliant" => undefined,
              "module-slot" => undefined,
              "profile" => undefined,
              "xa-datasource-class" => undefined
          }
      }
      
      

       

      This issue does not happen in standalone mode.

       

      After did some debugging, I found that the performRuntime() method of JdbcDriverAdd.java is not called in domain mode, but is called in standalone mode. is there anything related?