7 Replies Latest reply on Jul 12, 2017 4:44 AM by helper1000

    JBoss EAP 7.1 - JDBC driver IBM XA - Error

    helper1000

      Please could some one help, What will be the reason for the below error.

       

      I am using EAP 7.1 and I have tried to create a JDBC connection using IBM XA driver and its throwing the following error.  The drivers have been copied over the below folder.

       

      The database is not available, I hope that is not an issue to create the connection.

       

      Modules Location :

       

      jboss-eap/modules/com/ibm/main

       

      List of files available at the below location is :

       

       

      -rw-r--r--. 1 jboss-eap jboss-eap 3433725 Jun  2 09:01 db2jcc4.jar

      -rw-r--r--. 1 jboss-eap jboss-eap 3668626 Jun  5 11:11 db2jcc.jar

      -rw-r--r--. 1 jboss-eap jboss-eap   23709 Jun  5 11:11 db2jcc_javax.jar

      -rw-r--r--. 1 jboss-eap jboss-eap    2200 Jun  2 09:01 db2jcc_license_cisuz.jar

      -rw-r--r--. 1 jboss-eap jboss-eap     327 Jun  2 09:02 module.xml

      -rw-r--r--. 1 jboss-eap jboss-eap 1541182 Jun  2 09:01 sqlj4.jar

       

      contents for the module.xml file.

       

       

      cat module.xml

      <module xmlns="urn:jboss:module:1.1" name="com.ibm">

        <resources>

          <resource-root path="db2jcc4.jar"/>

        <resource-root path="db2jcc_license_cisuz.jar"/>

        <resource-root path="sqlj4.jar"/>

        </resources>

        <dependencies>

          <module name="javax.api"/>

          <module name="javax.transaction.api"/>

        </dependencies>

      </module>

       

      Error thrown was:

       

       

      2017-06-05 10:29:46,740 ERROR [org.jboss.as.controller.management-operation] (ServerService Thread Pool -- 73) WFLYCTL0013: Operation ("add") failed - address: ([

          ("subsystem" => "datasources"),

          ("xa-data-source" => "DB2XADS")

      ]) - failure description: {

          "WFLYCTL0412: Required services that are not installed:" => ["jboss.jdbc-driver.ibmdb2"],

          "WFLYCTL0180: Services with missing/unavailable dependencies" => [

              "jboss.driver-demander.java:/DB2XADS is missing [jboss.jdbc-driver.ibmdb2]",

              "org.wildfly.data-source.DB2XADS is missing [jboss.jdbc-driver.ibmdb2]"

          ]

      }

      2017-06-05 10:29:46,755 INFO  [org.jboss.as.controller] (ServerService Thread Pool -- 73) WFLYCTL0183: Service status report

      WFLYCTL0184:    New missing/unsatisfied dependencies:

            service jboss.data-source.reference-factory.DB2XADS (missing) dependents: [service jboss.naming.context.java.DB2XADS]

            service jboss.jdbc-driver.ibmdb2 (missing) dependents: [service jboss.driver-demander.java:/DB2XADS, service org.wildfly.data-source.DB2XADS]

            service jboss.xa-data-source-config.DB2XADS (missing) dependents: [service org.wildfly.data-source.DB2XADS]

        • 1. Re: JBoss EAP 7.1 - JDBC driver IBM XA - Error
          helper1000

          Was there any issue of adding the jdbc driver when the server was up and running? It seems for me is now working.  If i stop the server instance and add the JDBC connection creation but during the start up it throws the below error.

           

          =======

           

          2017-06-05 16:05:10,112 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("add") failed - address: ([

              ("subsystem" => "datasources"),

              ("xa-data-source" => "DB2XADS")

          ]) - failure description: {

              "WFLYCTL0412: Required services that are not installed:" => ["jboss.jdbc-driver.ibmdb2"],

              "WFLYCTL0180: Services with missing/unavailable dependencies" => [

                  "jboss.driver-demander.java:/DB2XADS is missing [jboss.jdbc-driver.ibmdb2]",

                  "org.wildfly.data-source.DB2XADS is missing [jboss.jdbc-driver.ibmdb2]"

              ]

          }

          2017-06-05 16:05:10,118 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("add") failed - address: ([

              ("subsystem" => "datasources"),

              ("xa-data-source" => "DB2XADS")

          ]) - failure description: {

              "WFLYCTL0412: Required services that are not installed:" => [

                  "jboss.jdbc-driver.ibmdb2",

                  "jboss.jdbc-driver.ibmdb2"

              ],

              "WFLYCTL0180: Services with missing/unavailable dependencies" => [

                  "jboss.driver-demander.java:/DB2XADS is missing [jboss.jdbc-driver.ibmdb2]",

                  "org.wildfly.data-source.DB2XADS is missing [jboss.jdbc-driver.ibmdb2]",

                  "org.wildfly.data-source.DB2XADS is missing [jboss.jdbc-driver.ibmdb2]"

              ]

          }

          2017-06-05 16:05:10,177 INFO  [org.jboss.as.controller] (Controller Boot Thread) WFLYCTL0183: Service status report

          WFLYCTL0184:    New missing/unsatisfied dependencies:

                service jboss.jdbc-driver.ibmdb2 (missing) dependents: [service jboss.driver-demander.java:/DB2XADS, service org.wildfly.data-source.DB2XADS]

          • 2. Re: JBoss EAP 7.1 - JDBC driver IBM XA - Error
            andey
            Example IBM DB2 XA Datasource Configuration:

             

            <datasources>

              <xa-datasource jndi-name="java:jboss/DB2XADS" pool-name="DB2XADS">

               <xa-datasource-property name="ServerName">

              localhost

               </xa-datasource-property>

               <xa-datasource-property name="DatabaseName">

              ibmdb2db

               </xa-datasource-property>

               <xa-datasource-property name="PortNumber">

              50000

               </xa-datasource-property>

               <xa-datasource-property name="DriverType">

              4

               </xa-datasource-property>

               <driver>ibmdb2</driver>

               <xa-pool>

               <is-same-rm-override>false</is-same-rm-override>

               </xa-pool>

               <security>

               <user-name>admin</user-name>

               <password>admin</password>

               </security>

               <recovery>

               <recover-plugin class-name="org.jboss.jca.core.recovery.ConfigurableRecoveryPlugin">

               <config-property name="EnableIsValid">

              false

               </config-property>

               <config-property name="IsValidOverride">

              false

               </config-property>

               <config-property name="EnableClose">

              false

               </config-property>

               </recover-plugin>

               </recovery>

               <validation>

               <valid-connection-checker class-name="org.jboss.jca.adapters.jdbc.extensions.db2.DB2ValidConnectionChecker"/>

               <validate-on-match>true</validate-on-match>

               <background-validation>false</background-validation>

               <stale-connection-checker class-name="org.jboss.jca.adapters.jdbc.extensions.db2.DB2StaleConnectionChecker"/>

               <exception-sorter class-name="org.jboss.jca.adapters.jdbc.extensions.db2.DB2ExceptionSorter"/>

               </validation>

              </xa-datasource>

              <drivers>

               <driver name="ibmdb2" module="com.ibm">

               <xa-datasource-class>com.ibm.db2.jcc.DB2XADataSource</xa-datasource-class>

               </driver>

              </drivers>

            </datasources>

             

             

            Example IBM DB2 JDBC Driver module.xml File:

             

            <?xml version="1.0" ?>

            <module xmlns="urn:jboss:module:1.1" name="com.ibm">

              <resources>

               <resource-root path="db2jcc4.jar"/>

              </resources>

              <dependencies>

               <module name="javax.api"/>

               <module name="javax.transaction.api"/>

              </dependencies>

            </module>

             

            Example Management CLI Commands

            This example configuration can be achieved by using the following management CLI commands.

            1. Add the IBM DB2 JDBC driver as a core module:

            module add --name=com.ibm --resources=/path/to/db2jcc4.jar --dependencies=javax.api,javax.transaction.api

             

            2.Register the IBM DB2 JDBC driver:

             

            /subsystem=datasources/jdbc-driver=ibmdb2:add(driver-name=ibmdb2,driver-module-name=com.ibm,driver-xa-datasource-class-name=com.ibm.db2.jcc.DB2XADataSource)

             

            3.Add the IBM DB2 XA datasource.

             

            xa-data-source add --name=DB2XADS --jndi-name=java:jboss/DB2XADS --driver-name=ibmdb2 --user-name=admin --password=admin --validate-on-match=true --background-validation=false --background-validation=false --valid-connection-checker-class-name=org.jboss.jca.adapters.jdbc.extensions.db2.DB2ValidConnectionChecker --exception-sorter-class-name=org.jboss.jca.adapters.jdbc.extensions.db2.DB2ExceptionSorter --stale-connection-checker-class-name=org.jboss.jca.adapters.jdbc.extensions.db2.DB2StaleConnectionChecker --same-rm-override=false --recovery-plugin-class-name=org.jboss.jca.core.recovery.ConfigurableRecoveryPlugin --recovery-plugin-properties={"EnableIsValid"=>"false","IsValidOverride"=>"false","EnableClose"=>"false"} --xa-datasource-properties={"ServerName"=>"localhost","DatabaseName"=>"ibmdb2db","PortNumber"=>"50000","DriverType"=>"4"}
            • 3. Re: JBoss EAP 7.1 - JDBC driver IBM XA - Error
              helper1000

              Thanks for reply. As far as I see first 2 steps are correct but the 3rd step have been created via puppet.  Let me manually run the step and see whether that makes any difference.

              • 4. Re: JBoss EAP 7.1 - JDBC driver IBM XA - Error
                helper1000

                I am getting the following exception when I try to use the above command.

                 

                 

                Exception for xa-data-source add --name=DB2XADS --jndi-name=java:jboss/DB2XADS --driver-name=ibmdb2 --user-name=admin --password=admin --validate-on-match=true --background-validation=false --background-validation=false --valid-connection-checker-class-name=org.jboss.jca.adapters.jdbc.extensions.db2.DB2ValidConnectionChecker --exception-sorter-class-name=org.jboss.jca.adapters.jdbc.extensions.db2.DB2ExceptionSorter --stale-connection-checker-class-name=org.jboss.jca.adapters.jdbc.extensions.db2.DB2StaleConnectionChecker --same-rm-override=false --recovery-plugin-class-name=org.jboss.jca.core.recovery.ConfigurableRecoveryPlugin --recovery-plugin-properties={"EnableIsValid"=>"false","IsValidOverride"=>"false","EnableClose"=>"false"} --xa-datasource-properties={"ServerName"=>"localhost","DatabaseName"=>"ibmdb2db","PortNumber"=>"50000","DriverType"=>"4"}: java.lang.UnsupportedOperationException

                • 5. Re: JBoss EAP 7.1 - JDBC driver IBM XA - Error
                  andey

                  Check whether you've placed multiple JDBC driver jars in your system classpath.

                  • 6. Re: JBoss EAP 7.1 - JDBC driver IBM XA - Error
                    helper1000

                    The following files exist

                     

                    -rw-r--r--. 1 jboss-eap jboss-eap 3433725 Jun  2 09:01 db2jcc4.jar

                    -rw-r--r--. 1 jboss-eap jboss-eap    2200 Jun  2 09:01 db2jcc_license_cisuz.jar

                    -rw-r--r--. 1 jboss-eap jboss-eap     327 Jun  2 09:02 module.xml

                     

                    • 7. Re: JBoss EAP 7.1 - JDBC driver IBM XA - Error
                      helper1000

                      I have managed to spend some time on this issue and resolved finally.

                       

                      Issue which I was facing is:

                       

                      Detected driver name was used as : ibm but it expects ibmdb2.

                       

                      Thanks for the response earlier.