Uploaded image for project: 'WildFly'
  1. WildFly
  2. WFLY-11986

HAL Console places <datasource-class> in <datasource> element in standalone.xml. It leads to Test Connection fail

    XMLWordPrintable

Details

    • Hide

      0. Start standalone.bat
      1. Create directory %WILDFLY_HOME%\modules\com\microsoft\main
      2. Copy driver mssql-jdbc-6.2.2.jre7.jar into %WILDFLY_HOME%\modules\com\microsoft\main
      https://www.microsoft.com/en-us/download/details.aspx?id=55539
      3. Make file module.xml
      <module xmlns="urn:jboss:module:1.3" name="com.microsoft">
      <resources>
      <resource-root path="mssql-jdbc-6.2.2.jre7.jar"/>
      </resources>
      <dependencies>
      <module name="javax.api"/>
      <module name="javax.transaction.api"/>
      <module name="javax.xml.bind.api"/>
      </dependencies>
      </module>
      4. Insert into standalone.xml in <drivers> section
      <driver name="sqlserver" module="com.microsoft">
      <driver-class>com.microsoft.sqlserver.jdbc.SQLServerDriver</driver-class>
      </driver>
      5. In HAL Console Runtime -> Reload
      Configuration -> Subsystems -> Datasources&Drivers -> Non-XA -> Add Datasource
      6. Microsoft SQLServer -> Next -> name: MSSQLDS, JNDI Name: java:/MSSQLDS -> [All default] -> Connection URL: jdbc:sqlserver://10.21.21.95:1433;DatabaseName=TESTDB ->Test Connection.
      7. Fail.

      Show
      0. Start standalone.bat 1. Create directory %WILDFLY_HOME%\modules\com\microsoft\main 2. Copy driver mssql-jdbc-6.2.2.jre7.jar into %WILDFLY_HOME%\modules\com\microsoft\main https://www.microsoft.com/en-us/download/details.aspx?id=55539 3. Make file module.xml <module xmlns="urn:jboss:module:1.3" name="com.microsoft"> <resources> <resource-root path="mssql-jdbc-6.2.2.jre7.jar"/> </resources> <dependencies> <module name="javax.api"/> <module name="javax.transaction.api"/> <module name="javax.xml.bind.api"/> </dependencies> </module> 4. Insert into standalone.xml in <drivers> section <driver name="sqlserver" module="com.microsoft"> <driver-class>com.microsoft.sqlserver.jdbc.SQLServerDriver</driver-class> </driver> 5. In HAL Console Runtime -> Reload Configuration -> Subsystems -> Datasources&Drivers -> Non-XA -> Add Datasource 6. Microsoft SQLServer -> Next -> name: MSSQLDS, JNDI Name: java:/MSSQLDS -> [All default] -> Connection URL: jdbc:sqlserver://10.21.21.95:1433;DatabaseName=TESTDB ->Test Connection. 7. Fail.
    • Compatibility/Configuration, User Experience
    • Workaround Exists
    • Hide

      1. Remove element <datasource-class>com.microsoft.sqlserver.jdbc.SQLServerDataSource</datasource-class> manualy from <datasource> element from standalone.xml
      2. Restart server

      Show
      1. Remove element <datasource-class>com.microsoft.sqlserver.jdbc.SQLServerDataSource</datasource-class> manualy from <datasource> element from standalone.xml 2. Restart server

    Description

      When Datasource for MSSQL is created through HAL Management console, it inserts tag <datasource-class>com.microsoft.sqlserver.jdbc.SQLServerDataSource</datasource-class> in <datasource> element in standalone.xml.
      Then when I try to test connection it fails with error "WFLYJCA0040: failed to invoke operation: WFLYJCA0047: Connection is not valid" If i remove element <datasource-class> manualy from standalone.xml, Test Connection works properly.

      2019-04-12 17:01:15,500 WARN [org.jboss.jca.core.connectionmanager.pool.strategy.OnePool] (External Management Request Threads – 2) 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:345)
       at org.jboss.jca.adapters.jdbc.local.LocalManagedConnectionFactory.getLocalManagedConnection(LocalManagedConnectionFactory.java:352)
       at org.jboss.jca.adapters.jdbc.local.LocalManagedConnectionFactory.createManagedConnection(LocalManagedConnectionFactory.java:287)
       at org.jboss.jca.core.connectionmanager.pool.mcp.SemaphoreConcurrentLinkedDequeManagedConnectionPool.createConnectionEventListener(SemaphoreConcurrentLinkedDequeManagedConnectionPool.java:1325)
       at org.jboss.jca.core.connectionmanager.pool.mcp.SemaphoreConcurrentLinkedDequeManagedConnectionPool.getConnection(SemaphoreConcurrentLinkedDequeManagedConnectionPool.java:499)
       at org.jboss.jca.core.connectionmanager.pool.AbstractPool.internalTestConnection(AbstractPool.java:1067)
       at org.jboss.jca.core.connectionmanager.pool.strategy.OnePool.testConnection(OnePool.java:93)
       at org.jboss.as.connector.subsystems.common.pool.PoolOperations$TestConnectionInPool.invokeCommandOn(PoolOperations.java:240)
       at org.jboss.as.connector.subsystems.common.pool.PoolOperations$1.execute(PoolOperations.java:97)
       at org.jboss.as.controller.AbstractOperationContext.executeStep(AbstractOperationContext.java:999)
       at org.jboss.as.controller.AbstractOperationContext.processStages(AbstractOperationContext.java:743)
       at org.jboss.as.controller.AbstractOperationContext.executeOperation(AbstractOperationContext.java:467)
       at org.jboss.as.controller.OperationContextImpl.executeOperation(OperationContextImpl.java:1412)
       at org.jboss.as.controller.ModelControllerImpl.internalExecute(ModelControllerImpl.java:423)
       at org.jboss.as.controller.ModelControllerImpl.lambda$execute$1(ModelControllerImpl.java:243)
       at org.jboss.as.controller.ModelControllerImpl$$Lambda$489/1626912192.run(Unknown Source)
       at org.wildfly.security.auth.server.SecurityIdentity$$Lambda$491/1133081806.run(Unknown Source)
       at org.wildfly.security.auth.server.SecurityIdentity.runAs(SecurityIdentity.java:289)
       at org.wildfly.security.auth.server.SecurityIdentity.runAs(SecurityIdentity.java:255)
       at org.jboss.as.controller.ModelControllerImpl.execute(ModelControllerImpl.java:243)
       at org.jboss.as.domain.http.server.DomainApiHandler.handleRequest(DomainApiHandler.java:212)
       at io.undertow.server.handlers.encoding.EncodingHandler.handleRequest(EncodingHandler.java:72)
       at org.jboss.as.domain.http.server.DomainApiCheckHandler.handleRequest(DomainApiCheckHandler.java:93)
       at org.jboss.as.domain.http.server.security.ElytronIdentityHandler.lambda$handleRequest$0(ElytronIdentityHandler.java:62)
       at org.jboss.as.domain.http.server.security.ElytronIdentityHandler$$Lambda$541/1958155244.run(Unknown Source)
       at org.wildfly.security.auth.server.SecurityIdentity$$Lambda$542/1328593333.run(Unknown Source)
       at org.wildfly.security.auth.server.SecurityIdentity.runAs(SecurityIdentity.java:313)
       at org.wildfly.security.auth.server.SecurityIdentity.runAs(SecurityIdentity.java:270)
       at org.jboss.as.controller.AccessAuditContext.doAs(AccessAuditContext.java:254)
       at org.jboss.as.controller.AccessAuditContext.doAs(AccessAuditContext.java:225)
       at org.jboss.as.domain.http.server.security.ElytronIdentityHandler.handleRequest(ElytronIdentityHandler.java:61)
       at io.undertow.server.handlers.BlockingHandler.handleRequest(BlockingHandler.java:56)
       at io.undertow.server.Connectors.executeRootHandler(Connectors.java:364)
       at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:830)
       at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
       at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1982)
       at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1486)
       at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1377)
       at java.lang.Thread.run(Thread.java:745)
       at org.jboss.threads.JBossThread.run(JBossThread.java:485)
       Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: Не удалось установить соединение TCP/IP к серверу localhost по порту 1433. Ошибка: "Connection refused: no further information. Проверьте свойства соединения. Убедитесь, что на сервере запущен экземпляр SQL Server и он принимает TCP/IP-соединения по порту. Убедитесь, что TCP-соединения по этому порту не блокируются брандмауэром.".
       at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDriverError(SQLServerException.java:227)
       at com.microsoft.sqlserver.jdbc.SQLServerException.ConvertConnectExceptionToSQLServerException(SQLServerException.java:284)
       at com.microsoft.sqlserver.jdbc.SocketFinder.findSocket(IOBuffer.java:2435)
       at com.microsoft.sqlserver.jdbc.TDSChannel.open(IOBuffer.java:635)
       at com.microsoft.sqlserver.jdbc.SQLServerConnection.connectHelper(SQLServerConnection.java:2010)
       at com.microsoft.sqlserver.jdbc.SQLServerConnection.login(SQLServerConnection.java:1687)
       at com.microsoft.sqlserver.jdbc.SQLServerConnection.connectInternal(SQLServerConnection.java:1528)
       at com.microsoft.sqlserver.jdbc.SQLServerConnection.connect(SQLServerConnection.java:866)
       at com.microsoft.sqlserver.jdbc.SQLServerDataSource.getConnectionInternal(SQLServerDataSource.java:968)
       at com.microsoft.sqlserver.jdbc.SQLServerDataSource.getConnection(SQLServerDataSource.java:78)
       at org.jboss.jca.adapters.jdbc.local.LocalManagedConnectionFactory.createLocalManagedConnection(LocalManagedConnectionFactory.java:314)
       ... 39 more 

      Attachments

        Activity

          People

            rhn-cservice-bbaranow Bartosz Baranowski
            lazarevd Dmitry Lazarev (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: