5 Replies Latest reply on Jul 14, 2015 3:59 AM by samalaraj72

    Can't create MySQL datasource in WildFly 9 CR1

    lpeter91

      Hello!

       

      Trying to create a MySQL datasource in the "wizard" of the administration console gives me the following error:

       

      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

      Unexpected HTTP response: 500

       

      Request

      {

        "address" => [

        ("subsystem" => "datasources"),

        ("data-source" => "MusicDS")

        ],

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

      }

       

      Response

       

      Internal Server Error

      {

        "outcome" => "failed",

        "failure-description" => "WFLYJCA0040: failed to invoke operation: WFLYJCA0042: failed to match pool. Check JndiName: java:/MusicDS",

        "rolled-back" => true,

        "response-headers" => {"process-state" => "reload-required"}

      }

      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

       

      I'm on a fully up-to-date Windows 8.1, with the latest Java (1.8.0_45) and connector (5.1.35) and WildFly 9 CR1. The connector is deployed and detected fine, the error happens when I try to test the connection. It was working fine in WildFly 8.2, and was broken for me in 9 Beta2 too. Tried it on 2 PCs, same result (very similar setup though). Now the "wizard" has changed a bit, and assuming this is not such a rare combination of components I might be doing something wrong.

       

      Someone had the same issue though (it's in German): Java-Forum.org

        • 1. Re: Can't create MySQL datasource in WildFly 9 CR1
          jaysensharma

          Hello,

            

              Does not look like a problem with WildFly9 as i tried the following on a fresh wildfly9 instance and it worked fine.

           

          Step-1).

          ======== Deployed the driver "mysql-connector-java-5.1.13-bin.jar" to standalone instance of wildfly 9

           

          09:26:28,466 INFO  [org.jboss.as.repository] (XNIO-1 task-6) WFLYDR0001: Content added at location /JBoss_WildFly/wildfly-9.0.0.CR1-SNAPSHOT/standalone/data/content/63/1249c6055be15a1fab26b3c28a3e5c6f3d97e0/content

          09:26:28,574 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-7) WFLYSRV0027: Starting deployment of "mysql-connector-java-5.1.13-bin.jar" (runtime-name: "mysql-connector-java-5.1.13-bin.jar")

          09:26:28,664 INFO  [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-4) WFLYJCA0005: Deploying non-JDBC-compliant driver class com.mysql.jdbc.Driver (version 5.1)

          09:26:28,668 INFO  [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-4) WFLYJCA0018: Started Driver service with driver-name = mysql-connector-java-5.1.13-bin.jar

          09:26:28,734 INFO  [org.jboss.as.server] (XNIO-1 task-2) WFLYSRV0010: Deployed "mysql-connector-java-5.1.13-bin.jar" (runtime-name : "mysql-connector-java-5.1.13-bin.jar")

           

           

          Step-2).

          ======== Created DataSource as following using CLI and then tested:

           

          [standalone@localhost:9990 /]

          [standalone@localhost:9990 /] /subsystem=datasources/data-source=MusicDS:add(jndi-name=java:/MusicDS,connection-url="jdbc:mysql://localhost:3306/testDB",driver-name=mysql-connector-java-5.1.13-bin.jar,user-name=root,password=test456)

          {"outcome" => "success"}

           

          [standalone@localhost:9990 /]

          [standalone@localhost:9990 /] /subsystem=datasources/data-source=MusicDS:test-connection-in-pool

          {

              "outcome" => "success",

              "result" => [true]

          }

           

           

             I do not see any issue with the WildFly 9.  Can you please share more details about datasource which you configured ? Please post the XML snippet of your datasource.

           

             Also we see that in your output * {"process-state" => "reload-required"}*   Which indicates that you might have made some changes which needs a reload.  Did you try reloading ?

           

             Also when you got the following error then did you notice any ERROR in the server.log,   Can you please share that log snippet ?

           

             [WFLYJCA0042: failed to match pool. Check JndiName: java:/MusicDS"]

          • 2. Re: Can't create MySQL datasource in WildFly 9 CR1
            jaysensharma

            You are right,   Then i verified it with the "console"    http://localhost:9990/console/App.html#datasources

             

            When we try creating a new DataSource from Console then if fails with the same error:

             

            The reason so far i see is that is is because of incorrectly generated  pool setting.  Notice  <max-pool-size>0</max-pool-size>

             

                                <pool>

                                    <min-pool-size>0</min-pool-size>

                                    <initial-pool-size>0</initial-pool-size>

                                    <max-pool-size>0</max-pool-size>

                                    <allow-multiple-users>false</allow-multiple-users>

                                </pool>

             

             

            Can you try removing this  setting from your DataSource  (Not from the console)  rather manually by editing the standalone.xml    and then test.               (this is just a workaround) 

             

            max-pool-size is Zero which means it wont allow even a single connection.  I reported this issue:  https://issues.jboss.org/browse/WFLY-4615

            • 3. Re: Can't create MySQL datasource in WildFly 9 CR1
              lpeter91

              Workaround works. Thanks for the help and creating the report!

              • 4. Re: Can't create MySQL datasource in WildFly 9 CR1
                mitrandir

                Had the same problem but with postgresql.

                 

                I couldn't manage to add datasource through gui,

                but tryed as you wrote in comand line cli, all worked fine.

                I looked settings in GUI console, and settings were the same as i entered first time in GUI..

                • 5. Re: Can't create MySQL datasource in WildFly 9 CR1
                  samalaraj72

                  Hi Jay,

                   

                  In Step-2). As i tried to Add data Source with web console,

                                 am unable to detect the Driver

                       FYI : i have deployed mysql.jar file

                               i have com.mysql module in modules folders, but still it's unable to detect,

                   

                  can you try step 2 from web console ?