6 Replies Latest reply on Jan 17, 2019 8:42 AM by surfspider

    microsoft sql server configuration wildfly 14

    surfspider

      I want to use MS SQL Server as a datasource in Wildfly 14, but I always get following error in the console:

       

      ERROR [org.jboss.as.controller.management-operation] (ServerService Thread Pool -- 41) WFLYCTL0013: Operation ("add") failed - address: ([("subsystem" => "datasources"),("jdbc-driver" => "sqlserver")]) - failure description: "WFLYJCA0115: Module for driver [com.microsoft.sqlserver.jdbc] or one of it dependencies is missing: [com.microsoft.sqlserver.jdbc]"

       

      You can also see my configurations on stackoverflow: wildfly 14 micorosoft sql server configuration - Stack Overflow

       

      With Wildfly 13 and before I had no problems.

       

      Which JDBC driver version from microsoft are supported by wildfly (Download Microsoft JDBC Driver for SQL Server | Microsoft Docs )?

      How can I configure it?

       

      Thank you in advance for your answer.

        • 1. Re: microsoft sql server configuration wildfly 14
          simkam

          Hi,

           

          from your SO post.

           

          <xa-datasource-class>com.microsoft.sqlserver.jdbc.SQLServerDriver</xa-datasource-class>

           

          com.microsoft.sqlserver.jdbc.SQLServerDriver is java.sql.Driver implementation, not javax.sql.XADataSource implementation. Correct class is com.microsoft.sqlserver.jdbc.SQLServerXADataSource.

          1 of 1 people found this helpful
          • 2. Re: microsoft sql server configuration wildfly 14
            grossmeister_g

            Hi,

            i had similar problems with the mysql driver. My configuration worked on Wildfly 9 and 13, but not on 14.

            Then i found this:

            WildFly-14: java.lang.ClassNotFoundException: com.mysql.jdbc.jdbc2.optional.MysqlXADataSource

            When i removed the <xa-datasource-class>...</xa-datasource-class> tags and content, the AS started as expected.

            • 3. Re: microsoft sql server configuration wildfly 14
              surfspider

              Hi,

               

              Thanks for the answers.

               

              I tried to add the correct SQLServerXADataSource class and i also tried to remove the <xa-datasource-class> tag from the <driver>-tag, both without success.

              The following configuration also don't work:

               

                                 <drivers>

                                  <driver name="h2" module="com.h2database.h2">

                                      <xa-datasource-class>org.h2.jdbcx.JdbcDataSource</xa-datasource-class>

                                  </driver>

                                  <driver name="sqlserver" module="com.microsoft.sqlserver.jdbc">

                                      <driver-class>com.microsoft.sqlserver.jdbc.SQLServerDriver</driver-class>

                                      <xa-datasource-class>com.microsoft.sqlserver.jdbc.SQLServerXADataSource</xa-datasource-class>

                                      <datasource-class>com.microsoft.sqlserver.jdbc.SQLServerDataSource</datasource-class>

                                  </driver>

                              </drivers>

               

              I still get the error with the mssing dependencies (com.microsoft.sqlserver.jdbc).

               

              I can found the driver in the administration GUI (Configuration -> Subsystems -> Datasource & Drivers -> JDBC Driver), but the values for the fields 'driver version' and 'JDBC compliant' are missing.

              • 4. Re: microsoft sql server configuration wildfly 14
                simkam

                Hi,

                 

                do you have module with path <WILDFLY_HOME>/modules/com/microsoft/sqlserver/jdbc? What jars are there? Full path to main slot should be <WILDFLY_HOME>/modules/com/microsoft/sqlserver/jdbc/main. What is the content of module.xml file (<WILDFLY_HOME>/modules/com/microsoft/sqlserver/jdbc/main/module.xml)?

                • 5. Re: microsoft sql server configuration wildfly 14
                  majidmostafavi

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

                    <resources>

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

                    </resources>

                    <dependencies>

                      <module name="javax.api"/>

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

                      <module name="javax.xml.bind.api"/>

                    </dependencies>

                  </module>

                   

                    <driver name="sqlserver" module="com.microsoft.sqlserver">

                                          <xa-datasource-class>com.microsoft.sqlserver.jdbc.SQLServerXADataSource</xa-datasource-class>

                  </driver>

                  • 6. Re: microsoft sql server configuration wildfly 14
                    surfspider

                    Thank you for your answers. This one helped me: Wildfly 14 Microsoft SQL Server Configuration - Stack Overflow