6 Replies Latest reply on Jun 16, 2016 4:35 AM by olgun.kaya

    Jboss EAP 6.4 Mysql XA-Datasource Problem

    olgun.kaya

      Hi,

      We have upgradede from eap-6.3 to eap-6.4 and our working datasource configuration is not working anymore.

       

      The error we are receiving is :

      Unexpected HTTP response: 500

       

      Request

      {

        "address" => [

        ("host" => "sv-host"),

        ("server" => "sc-host-1"),

        ("subsystem" => "datasources"),

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

        ],

        "operation" => "test-connection-in-pool"

      }

       

      Response

       

      Internal Server Error

      {

        "outcome" => "failed",

        "result" => undefined,

        "failure-description" => "JBAS010440: failed to invoke operation: JBAS010442: failed to match pool. Check JndiName: java:/jdbc/facebook_data_source",

        "rolled-back" => true

      }

       

      Configuration :

       

      Module Configuration

       

      In : /usr/local/jboss/modules/com/mysql/main  //where jboss is a link to eap-6.4

       

      module.xml

       

      <module xmlns="urn:jboss:module:1.0" name="com.mysql"> 

        <resources> 

          <resource-root path="mysql-connector-java-5.1.38-bin.jar"/> 

        </resources> 

        <dependencies> 

          <module name="javax.api"/>

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

        </dependencies> 

      </module>

       

      and the jar is sitting next to this module.xml file.

       

       

      Domain Configuration


      path : /usr/local/jboss/domain/configuration //where again jboss is a link to eap-6.4

       

      domain.xml

       

      <xa-datasource jndi-name="java:/jdbc/facebook_data_source" pool-name="jdbc_facebook_data_source" enabled="true" use-ccm="false">

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

                                  **********

                              </xa-datasource-property>

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

                                   *********

                              </xa-datasource-property>

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

                                  jdbc:mysql://<ip>:<port>/<dbname>

                              </xa-datasource-property>

                              <xa-datasource-class>com.mysql.jdbc.jdbc2.optional.MysqlXADataSource</xa-datasource-class>

                              <driver>com.mysql</driver>

                              <transaction-isolation>TRANSACTION_READ_COMMITTED</transaction-isolation>

                              <xa-pool>

                                  <min-pool-size>1</min-pool-size>

                                  <max-pool-size>100</max-pool-size>

                                  <use-strict-min>false</use-strict-min>

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

                                  <interleaving>false</interleaving>

                                  <no-tx-separate-pools>true</no-tx-separate-pools>

                                  <pad-xid>false</pad-xid>

                                  <wrap-xa-resource>false</wrap-xa-resource>

                              </xa-pool>

                              <validation>

                                  <validate-on-match>false</validate-on-match>

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

                              </validation>

                              <timeout>

                                  <set-tx-query-timeout>false</set-tx-query-timeout>

                                  <blocking-timeout-millis>0</blocking-timeout-millis>

                                  <idle-timeout-minutes>3</idle-timeout-minutes>

                                  <query-timeout>0</query-timeout>

                                  <use-try-lock>0</use-try-lock>

                                  <allocation-retry>0</allocation-retry>

                                  <allocation-retry-wait-millis>0</allocation-retry-wait-millis>

                                  <xa-resource-timeout>0</xa-resource-timeout>

                              </timeout>

                              <statement>

                                  <share-prepared-statements>false</share-prepared-statements>

                              </statement>

      </xa-datasource>

       

      <driver name="com.mysql" module="com.mysql">

                                  <driver-class>com.mysql.jdbc.Driver</driver-class>

                                  <xa-datasource-class>com.mysql.jdbc.jdbc2.optional.MysqlXADataSource</xa-datasource-class>

      </driver>

       

       

       

       

      This config was working properly with eap-6.3

        • 1. Re: Jboss EAP 6.4 Mysql XA-Datasource Problem
          amit12345

          Hi,

          It seems that you have not added  XA properties in your XML file.

          XA properties:

          1) databaseName

          2) serverName

          3) portNumber

           

          please add the same as above and let me know the output.

          • 2. Re: Jboss EAP 6.4 Mysql XA-Datasource Problem
            olgun.kaya

            I tried this exact configuration on my local with eap 6.4.0 and it worked.

             

            Also the way you suggest is an optional one. either you set all those via properties one by one or you set all in one as I did below

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

                                        jdbc:mysql://<ip>:<port>/<dbname>

            </xa-datasource-property>

             

            Checking mysql connector source. it creates this URL object if you set parameters one by one as in your suggestion.

            • 3. Re: Jboss EAP 6.4 Mysql XA-Datasource Problem
              abhijithumbe

              Normally this exception occurs when try to check datasource connection pool when datasource is not enabled. Make sure datasource is enabled before testing connection.

              • 4. Re: Jboss EAP 6.4 Mysql XA-Datasource Problem
                olgun.kaya

                I checked. It seems ok. Have no idea what is changed between updates. 6.3 to 6.4.6 and now it stopped working.

                • 5. Re: Jboss EAP 6.4 Mysql XA-Datasource Problem
                  olgun.kaya

                  I found one more log in the server startup. Which is a bit cheaky.

                   

                  [#|2016-06-16 10:26:34,375|ERROR|[org.jboss.as.controller.management-operation]|(ThreadId: Controller Boot Thread)|JBAS014612: Operation ("add") failed - address: ([

                      ("subsystem" => "datasources"),

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

                  ]) - failure description: {"JBAS014771: Services with missing/unavailable dependencies" => [

                      "jboss.data-source.java:/jdbc/facebook_data_source is missing [jboss.jdbc-driver.com_mysql]",

                      "jboss.driver-demander.java:/jdbc/facebook_data_source is missing [jboss.jdbc-driver.com_mysql]"

                  ]}|#]

                  [#|2016-06-16 10:26:34,381|ERROR|[org.jboss.as.controller.management-operation]|(ThreadId: Controller Boot Thread)|JBAS014612: Operation ("enable") failed - address: ([

                      ("subsystem" => "datasources"),

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

                  ]) - failure description: {"JBAS014879: One or more services were unable to start due to one or more indirect dependencies not being available." => {

                      "Services that were unable to start:" => [

                          "jboss.data-source.reference-factory.jdbc_facebook_data_source",

                          "jboss.naming.context.java.jdbc.facebook_data_source"

                      ],

                      "Services that may be the cause:" => ["jboss.jdbc-driver.com_mysql"]

                  }}|#]

                  [#|2016-06-16 10:26:34,726|INFO |[org.jboss.as.controller]|(ThreadId: Controller Boot Thread)|JBAS014774: Service status report

                  JBAS014775:    New missing/unsatisfied dependencies:

                        service jboss.jdbc-driver.com_mysql (missing) dependents: [service jboss.data-source.java:/jdbc/facebook_data_source, service jboss.driver-demander.java:/jdbc/facebook_data_source]

                  |#]

                   

                   

                  It is somehow unable to find the driver.

                  • 6. Re: Jboss EAP 6.4 Mysql XA-Datasource Problem
                    olgun.kaya

                    I think I found the issue. Sadly the operation team has created a folder with the same name of jar file. Which is hard to recognize. and the actual jar is in that file. Will fix the paths and files. then retry.