["jboss.jdbc-driver.mysql"]-6ren"> ["jboss.jdbc-driver.mysql"]-我正在尝试将 mysql 数据源添加到我的 Wildfly(Jboss15.0.0) 服务器。 但我遇到以下错误: WFLYCTL0013: Operation ("add") failed - ad-6ren">
gpt4 book ai didi

jboss - "WFLYCTL0412: Required services that are not installed:"=> ["jboss.jdbc-driver.mysql"]

转载 作者:行者123 更新时间:2023-12-03 17:03:32 25 4
gpt4 key购买 nike

我正在尝试将 mysql 数据源添加到我的 Wildfly(Jboss15.0.0) 服务器。
但我遇到以下错误:

WFLYCTL0013: Operation ("add") failed - address: ([
("subsystem" => "datasources"),
("data-source" => "MySqlDS")
]) - failure description: {
"WFLYCTL0412: Required services that are not installed:" => ["jboss.jdbc-driver.mysql"],
"WFLYCTL0180: Services with missing/unavailable dependencies" => [
"org.wildfly.data-source.MySqlDS is missing [jboss.jdbc-driver.mysql]",
"jboss.driver-demander.java:/MySqlDS is missing [jboss.jdbc-driver.mysql]"
]
}
09:22:10,385 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("add") failed - address: ([
("subsystem" => "datasources"),
("data-source" => "MySqlDS")
]) - failure description: {
"WFLYCTL0412: Required services that are not installed:" => [
"jboss.jdbc-driver.mysql",
"jboss.jdbc-driver.mysql"
],
"WFLYCTL0180: Services with missing/unavailable dependencies" => [
"org.wildfly.data-source.MySqlDS is missing [jboss.jdbc-driver.mysql]",
"jboss.driver-demander.java:/MySqlDS is missing [jboss.jdbc-driver.mysql]",
"org.wildfly.data-source.MySqlDS is missing [jboss.jdbc-driver.mysql]"
]
}

这是我的module.xml:
<module xmlns="urn:jboss:module:1.0" name="mysql">
<resources>
<resource-root path="mysql-connector-java-5.1.46-bin.jar"/>
</resources>
<dependencies>
<module name="javax.api"/>
<module name="javax.transaction.api"/>
</dependencies>
</module>

这是我设置数据源的代码:
    <datasources>
<datasource jndi-name="java:jboss/datasources/ExampleDS" pool-name="ExampleDS" enabled="true" use-java-context="true">
<connection-url>jdbc:h2:mem:test;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE</connection-url>
<driver>h2</driver>
<security>
<user-name>sa</user-name>
<password>sa</password>
</security>
</datasource>
<datasource jta="true" jndi-name="java:/MySqlDS" pool-name="MySqlDS" use-java-context="true" use-ccm="true">
<connection-url>jdbc:mysql://localhost:3306/onlinestock?characterEncoding=UTF8&amp;useSSL=false&amp;serverTimezone=GMT%2B8&amp;allowPublicKeyRetrieval=true</connection-url>
<driver>mysql</driver>
<transaction-isolation>TRANSACTION_READ_COMMITTED</transaction-isolation>
<pool>
<prefill>true</prefill>
<use-strict-min>false</use-strict-min>
<flush-strategy>FailingConnectionOnly</flush-strategy>
</pool>
<security>
<user-name>root</user-name>
<password>root</password>
</security>
</datasource>
<drivers>
<driver name="h2" module="com.h2database.h2">
<xa-datasource-class>org.h2.jdbcx.JdbcDataSource</xa-datasource-class>
</driver>
<driver name="mysql" module="com.mysql">
<xa-datasource-class>com.mysql.jdbc.Driver</xa-datasource-class>
</driver>
</drivers>
</datasources>

为什么服务器看不到我的mysql-connector。
module.xml 在 JBOSS_HOME/../modules/../mysql/main 的 floder 下

最佳答案

我更改了 standalone.xml 并且它有效
以这种方式设置标签:

<driver name="mysql" module="com.mysql">
<driver-class>com.mysql.cj.jdbc.Driver</driver-class>
<xa-datasource-class>com.mysql.cj.jdbc.MysqlXADataSource</xa-datasource-class>
</driver>

也就是说我添加了标签并更改了内容

关于jboss - "WFLYCTL0412: Required services that are not installed:"=> ["jboss.jdbc-driver.mysql"],我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54067627/

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