SQL Server 2014 在 JBOSS EAP 6.4 数据源配置中无法连接
SQL Server 2014 fail to connect in JBOSS EAP 6.4 datasource configuration
我正在尝试在 JBOSS EAP 6.4 中为 SQL Server 2014 配置数据源,但在测试连接时失败。我尝试从 ECLIPSE 连接到 Sql 服务器并且它有效,所以问题出在 Jboss.
我的模块和jar在
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
独立-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>
测试连接错误(来自 JBOSS 控制台):
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
}
我发现了问题;我使用的是 sqljdbc42 并且 jboss eap 6.4 与版本 4 兼容。所以我替换了它并且测试连接有效。
我正在尝试在 JBOSS EAP 6.4 中为 SQL Server 2014 配置数据源,但在测试连接时失败。我尝试从 ECLIPSE 连接到 Sql 服务器并且它有效,所以问题出在 Jboss.
我的模块和jar在 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
独立-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>
测试连接错误(来自 JBOSS 控制台):
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
}
我发现了问题;我使用的是 sqljdbc42 并且 jboss eap 6.4 与版本 4 兼容。所以我替换了它并且测试连接有效。