![](/img/trans.png)
[英]On Wildfly 11 the Microsoft SQL Server driver incorrectly trys to connect to localhost
[英]Wildfly 14 Microsoft SQL Server Configuration
我想在Wildfly 14中使用MS SQL Server作為數據源,但我總是在控制台中出現以下錯誤:
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]"
我的配置如下:
standalone.xml
<drivers>
<driver name="sqlserver" module="com.microsoft.sqlserver">
<xa-datasource-class>com.microsoft.sqlserver.jdbc.SQLServerDriver</xa-datasource-class>
</driver>
</drivers>
我還在以下目錄中配置了一個module.xml:wildfly-14.0.1.Final \\ modules \\ system \\ layers \\ base \\ com \\ microsoft \\ sqlserver \\ main。 我也把sqljdbc42.jar放在里面。
<module xmlns="urn:jboss:module:1.3" name="com.microsoft.sqlserver.jdbc">
<resources>
<resource-root path="sqljdbc42.jar"/>
</resources>
<dependencies>
<module name="javax.api"/>
<module name="javax.transaction.api"/>
</dependencies>
</module>
使用Wildfly 13之前我沒有遇到任何問題。
我相信standalone.xml中的driver
配置仍然是錯誤的。
以下必須相同。
在standalone.xml中:
<driver name="sqlserver" module="com.microsoft.sqlserver.jdbc">
在module.xml中:
<module xmlns="urn:jboss:module:1.3" name="com.microsoft.sqlserver.jdbc">
sqljdbc42.jar
和module.xml
位置:
JBOSS_HOME\modules\com\microsoft\sqlserver\jdbc\main\
我也相信你使用的是錯誤的xa-datasource-class,這應該是:
com.microsoft.sqlserver.jdbc.SQLServerXADataSource
另請參閱EAP7文檔 。 它應該是相同的野生蠅。 還有一個如何使用CLI的好例子。
將其添加到<dependencies>
標記內的module.xml
<module name="javax.xml.bind.api"/>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.