sql-serverjbossjboss-eap-6

SQL Server 2014 fail to connect in JBOSS EAP 6.4 datasource configuration


I'm trying to configure datasource for SQL Server 2014 in JBOSS EAP 6.4 but fails when I test the connection. I tried connecting from ECLIPSE to Sql Server and it works, so the problem is with Jboss.

My module and jar are in C:\jboss-eap-6.4\modules\system\layers\base\com\sqlserver\main

module.xml

<?xml version="1.0" encoding="UTF-8"?>
<module xmlns="urn:jboss:module:1.1" name="com.sqlserver">
    <resources>
        <resource-root path="sqljdbc42.jar"/>
        <!-- Insert resources here -->
    </resources>
    <dependencies>
        <module name="javax.api"/>
        <module name="javax.transaction.api"/>
    </dependencies>
</module>

JAR: sqljdbc42.jar

standalone-full.xml

<datasource jndi-name="java:/MSSQLDS" pool-name="MSSQLDS" enabled="true">
                    <connection-url>jdbc:sqlserver://localhost:1433;DatabaseName=motorNotificaciones</connection-url>
                    <driver>sqlserver</driver>
                    <security>
                        <user-name>sa</user-name>
                        <password>sa123</password>
                    </security>
                    <validation>
                        <valid-connection-checker class-name="org.jboss.jca.adapters.jdbc.extensions.mssql.MSSQLValidConnectionChecker"/>
                        <validate-on-match>true</validate-on-match>
                        <background-validation>false</background-validation>
                        <exception-sorter class-name="org.jboss.jca.adapters.jdbc.extensions.mssql.MSSQLExceptionSorter"/>
                    </validation>
                </datasource>
                <drivers>
                    <driver name="sqlserver" module="com.sqlserver"/>
                </drivers>

Test connection error (from JBOSS console):

Unexpected HTTP response: 500

Request
{
    "address" => [
        ("subsystem" => "datasources"),
        ("data-source" => "MSSQLDS")
    ],
    "operation" => "test-connection-in-pool"
}

Response

Internal Server Error
{
    "outcome" => "failed",
    "failure-description" => "JBAS010440: No se logró invocar la operación: JBAS010447: La conexión no es válida",
    "rolled-back" => true
}

Solution

  • I found the problem; I was using sqljdbc42 and jboss eap 6.4 is compatibility with version 4. So I replaced it and the testing connection worked.