gpt4 book ai didi

java - 无法在 Wildfly 10 中实例化驱动程序 SQLServerDriver

转载 作者:行者123 更新时间:2023-11-29 08:35:54 25 4
gpt4 key购买 nike

我有以下错误:

15:02:34,434 ERROR [org.jboss.as.controller.management-operation] (ServerService Thread Pool -- 33) WFLYCTL0013: Operation ("add") failed - address: ([
("subsystem" => "datasources"),
("jdbc-driver" => "sqlserver")
]) - failure description: "WFLYJCA0034: Unable to instantiate driver class \"com.microsoft.jdbc.sqlserver.SQLServerDriver\". See log (WARN) for more details"

$JBOSS_HOME\modules\com\microsoft\sqlserver\main 中的module.xml:

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

<resources>
<resource-root path="sqljdbc42.jar"/>
</resources>

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

这是sqljdbc42.jar的内容

content_of_sqljdbc42

以及standalone.xml中的驱动定义

<driver name="sqlserver" module="com.microsoft.sqlserver">
<driver-class>com.microsoft.jdbc.sqlserver.SQLServerDriver</driver-class>
</driver>

请帮我找出我没看到的东西

更新:

For historic context: the "com.microsoft.jdbc.sqlserver" package is from the old SQL Server 2000 JDBC driver, they changed it somewhere around 2005 to "com.microsoft.sqlserver.jdbc" by Mark Rotteveel

最佳答案

从jar内容可以看出你驱动中的class包是错误的,试试

<driver name="sqlserver" module="com.microsoft.sqlserver">
<driver-class>com.microsoft.sqlserver.jdbc.SQLServerDriver</driver-class>
</driver>

关于java - 无法在 Wildfly 10 中实例化驱动程序 SQLServerDriver,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44143316/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com