7 Replies Latest reply on Mar 21, 2016 8:35 AM by vlad ZHANG

    Failed to add datasource of sql server in Wildfly 9

    vlad ZHANG Newbie

      Hello,

       

       

      I encounter a problem in deploying datasource of sql server in Wildfly 9.

       

       

      The Wildfly version I have downloaded is Wildfly 9.2.0.Final. I added a user and entered the Administrator Console in a browser.

       

       

      The sql server version I have downloaded is sql server 2008. I want to deploy a datasource of sql server.

       

       

      I started to download a JDBC Driver. The version I have downloaded is "Microsoft JDBC Drivers 6.0 (Preview), 4.2, 4.1, and 4.0 for SQL Server" from "https://www.microsoft.com/en-us/download/details.aspx?displaylang=en&id=11774".

      I succeeded in adding this driver by choosing deployment--->add--->Upload a new deployment in the Administration Console. But when I try to add a datasource, I had a problem.

       

       

      In the "configuration" of Administration Console, I chose Subsystems--->Datasources--->Non-XA--->add. Then I chose the driver I had deployed. But I always cannot create this datasource, the error is always:

       

       

      Failed to create JDBC connection.

      An internal error occurred.

      Unexpected HTTP response: 500

       

       

      Request

      {

          "address" => [

              ("subsystem" => "datasources"),

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

          ],

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

      }

       

       

      Response

       

       

      Internal Server Error

      {

          "outcome" => "failed",

          "failure-description" => "WFLYJCA0040: failed to invoke operation: WFLYJCA0047: Connection is not valid",

          "rolled-back" => true,

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

      }

       

       

       

       

      And I don't know why. Could anyone help me, please? Thank you in advance.

        • 1. Re: Failed to add datasource of sql server in Wildfly 9
          vlad ZHANG Newbie

          In the log, I have :

           

          2016-03-18 14:54:11,481 INFO  [org.jboss.as.controller.management-deprecated] (XNIO-6 task-5) WFLYCTL0028: Attribute 'enabled' in the resource at address '/subsystem=datasources/data-source=MSSQLDS' is deprecated, and may be removed in future version. See the attribute description in the output of the read-resource-description operation to learn more about the deprecation.

          2016-03-18 14:54:11,497 INFO  [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-8) WFLYJCA0001: Bound data source [java:/MSSQLDS]

          2016-03-18 14:54:11,539 WARN  [org.jboss.jca.core.connectionmanager.pool.strategy.OnePool] (XNIO-6 task-6) IJ000604: Throwable while attempting to get a new connection: null: javax.resource.ResourceException: IJ031084: Unable to create connection

              at org.jboss.jca.adapters.jdbc.local.LocalManagedConnectionFactory.createLocalManagedConnection(LocalManagedConnectionFactory.java:336)

              at org.jboss.jca.adapters.jdbc.local.LocalManagedConnectionFactory.getLocalManagedConnection(LocalManagedConnectionFactory.java:343)

              at org.jboss.jca.adapters.jdbc.local.LocalManagedConnectionFactory.createManagedConnection(LocalManagedConnectionFactory.java:278)

              at org.jboss.jca.core.connectionmanager.pool.mcp.SemaphoreArrayListManagedConnectionPool.createConnectionEventListener(SemaphoreArrayListManagedConnectionPool.java:1289)

              at org.jboss.jca.core.connectionmanager.pool.mcp.SemaphoreArrayListManagedConnectionPool.getConnection(SemaphoreArrayListManagedConnectionPool.java:492)

              at org.jboss.jca.core.connectionmanager.pool.AbstractPool.internalTestConnection(AbstractPool.java:1071)

              at org.jboss.jca.core.connectionmanager.pool.strategy.OnePool.testConnection(OnePool.java:91)

              at org.jboss.as.connector.subsystems.common.pool.PoolOperations$TestConnectionInPool.invokeCommandOn(PoolOperations.java:232)

              at org.jboss.as.connector.subsystems.common.pool.PoolOperations$1.execute(PoolOperations.java:88)

              at org.jboss.as.controller.AbstractOperationContext.executeStep(AbstractOperationContext.java:803)

              at org.jboss.as.controller.AbstractOperationContext.doCompleteStep(AbstractOperationContext.java:601)

              at org.jboss.as.controller.AbstractOperationContext.completeStepInternal(AbstractOperationContext.java:354)

              at org.jboss.as.controller.AbstractOperationContext.executeOperation(AbstractOperationContext.java:330)

              at org.jboss.as.controller.OperationContextImpl.executeOperation(OperationContextImpl.java:1183)

              at org.jboss.as.controller.ModelControllerImpl.internalExecute(ModelControllerImpl.java:362)

              at org.jboss.as.controller.ModelControllerImpl.execute(ModelControllerImpl.java:218)

              at org.jboss.as.domain.http.server.DomainApiHandler.handleRequest(DomainApiHandler.java:208)

              at io.undertow.server.handlers.encoding.EncodingHandler.handleRequest(EncodingHandler.java:72)

              at org.jboss.as.domain.http.server.security.SubjectDoAsHandler$1.run(SubjectDoAsHandler.java:72)

              at org.jboss.as.domain.http.server.security.SubjectDoAsHandler$1.run(SubjectDoAsHandler.java:68)

              at java.security.AccessController.doPrivileged(Native Method)

          at javax.security.auth.Subject.doAs(Unknown Source)

              at org.jboss.as.controller.AccessAuditContext.doAs(AccessAuditContext.java:92)

              at org.jboss.as.domain.http.server.security.SubjectDoAsHandler.handleRequest(SubjectDoAsHandler.java:68)

              at org.jboss.as.domain.http.server.security.SubjectDoAsHandler.handleRequest(SubjectDoAsHandler.java:63)

              at io.undertow.server.handlers.BlockingHandler.handleRequest(BlockingHandler.java:56)

              at org.jboss.as.domain.http.server.DomainApiCheckHandler.handleRequest(DomainApiCheckHandler.java:95)

              at io.undertow.security.handlers.AuthenticationCallHandler.handleRequest(AuthenticationCallHandler.java:52)

              at io.undertow.server.Connectors.executeRootHandler(Connectors.java:199)

              at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:774)

              at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)

              at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)

              at java.lang.Thread.run(Unknown Source)

          Caused by: javax.resource.ResourceException: IJ031083: Wrong driver class [com.microsoft.sqlserver.jdbc.SQLServerDriver] for this connection URL [jdbc:microsoft:sqlserver://192.168.206.12\influval;DatabaseName=influval_wildfly]

              at org.jboss.jca.adapters.jdbc.local.LocalManagedConnectionFactory.createLocalManagedConnection(LocalManagedConnectionFactory.java:314)

              ... 32 more
          2016-03-18 14:54:11,565 ERROR [org.jboss.as.controller.management-operation] (XNIO-6 task-6) WFLYCTL0013: Operation ("test-connection-in-pool") failed - address: ([

             ("subsystem" => "datasources"),

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

          ]) - failure description: "WFLYJCA0040: failed to invoke operation: WFLYJCA0047: Connection is not valid"

          2016-03-18 14:54:11,581 INFO  [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-1) WFLYJCA0010: Unbound data source [java:/MSSQLDS]

          • 2. Re: Failed to add datasource of sql server in Wildfly 9
            vlad ZHANG Newbie

            And when I clicked "done" and retest the connection, I had:

             

            2016-03-18 15:11:01,051 INFO  [org.jboss.as.controller.management-deprecated] (XNIO-6 task-1) WFLYCTL0028: Attribute 'enabled' in the resource at address '/' is deprecated, and may be removed in future version. See the attribute description in the output of the read-resource-description operation to learn more about the deprecation.

            2016-03-18 15:11:38,661 INFO  [org.jboss.as.controller.management-deprecated] (XNIO-6 task-1) WFLYCTL0028: Attribute 'enabled' in the resource at address '/' is deprecated, and may be removed in future version. See the attribute description in the output of the read-resource-description operation to learn more about the deprecation.

            2016-03-18 15:11:43,167 ERROR [org.jboss.as.controller.management-operation] (XNIO-6 task-6) WFLYCTL0013: Operation ("test-connection-in-pool") failed - address: ([

               ("subsystem" => "datasources"),

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

            ]) - failure description: "WFLYJCA0040: failed to invoke operation: WFLYJCA0042: failed to match pool. Check JndiName: java:/influval_reference_DS"

            • 4. Re: Failed to add datasource of sql server in Wildfly 9
              vlad ZHANG Newbie

              Yes, I changed the "max pool size" to 100, but it still doesn't work ...

              • 5. Re: Failed to add datasource of sql server in Wildfly 9
                vlad ZHANG Newbie

                In fact, I changed the connection url and it worked.

                 

                Wrong url :

                jdbc:microsoft:sqlserver://(ip address):1433;DatabaseName=???

                Right url :

                jdbc:sqlserver://(ip address):1433;DatabaseName=???

                • 6. Re: Failed to add datasource of sql server in Wildfly 9
                  Wolfgang Mayer Master

                  Did you also reload the configuration after your change? Are the messages in the log still the same?

                  • 7. Re: Failed to add datasource of sql server in Wildfly 9
                    vlad ZHANG Newbie

                    Thank you for your help, in fact it's just because I've entered the wrong connection url. After I corrected it, it started to work.