【发布时间】:2017-05-03 08:11:41
【问题描述】:
我知道,这个问题是建立在所有 google 和 stackoverflow 上的,但是我的问题没有解决,我也没有找到解决方案 =/
所以,很简单,我的 WildFly 似乎看不到我的 mysql 连接器。
我尝试使用 mysql-connector-java-5.1.38
module.xml (wildfly-10.1.0.Final\modules\system\layers\base\com\mysql\main)
<?xml version="1.0" encoding="UTF-8"?>
<module xmlns="urn:jboss:module:1.3" name="com.mysql">
<resources>
<resource-root path="mysql-connector-java-5.1.38.jar"/>
</resources>
<dependencies>
<modue name="javax.api"/>
</dependencies>
</module>
在 mysql-connector-java-5.1.38 上尝试使用和不使用“.jar”
数据源
<datasources>
<datasource jndi-name="java:/budget-datasource" pool-name="budget-datasource" enabled="true" use-java-context="true" use-ccm="true">
<connection-url>jdbc:mysql://127.0.0.1:3306/budget?zeroDateTimeBehavior=convertToNull</connection-url>
<driver>mysql</driver>
<security>
<user-name>root</user-name>
</security>
</datasource>
<drivers>
<driver name="mysql" module="com.mysql">
<xa-datasource-class>com.mysql.jdbc.Driver</xa-datasource-class>
</driver>
</drivers>
</datasources>
我尝试替换
<xa-datasource-class>com.mysql.jdbc.Driver</xa-datasource-class>
通过
<driver>com.mysql.jdbc.Driver</driver>
但没用
完整有趣的堆栈跟踪 错误 [org.jboss.as.controller.management-operation] (ServerService 线程池 -- 33) WFLYCTL0013: 操作 ("add") 失败 - 地址: ([ (“子系统”=>“数据源”), ("jdbc-driver" => "mysql")
ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("add") failed - address: ([
("subsystem" => "datasources"),
("data-source" => "budget-datasource")
]) - failure description: {
"WFLYCTL0412: Required services that are not installed:" => ["jboss.jdbc-driver.mysql"],
"WFLYCTL0180: Services with missing/unavailable dependencies" => [
"org.wildfly.data-source.budget-datasource is missing [jboss.jdbc-driver.mysql]",
"jboss.driver-demander.java:/budget-datasource is missing [jboss.jdbc-driver.mysql]"
]
}
ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("add") failed - address: ([
("subsystem" => "datasources"),
("data-source" => "budget-datasource")
]) - 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.budget-datasource is missing [jboss.jdbc-driver.mysql]",
"jboss.driver-demander.java:/budget-datasource is missing [jboss.jdbc-driver.mysql]",
"org.wildfly.data-source.budget-datasource is missing [jboss.jdbc-driver.mysql]"
]
}
INFO [org.jboss.as.controller] (Controller Boot Thread) WFLYCTL0183: Service status report
WFLYCTL0184: New missing/unsatisfied dependencies:
service jboss.jdbc-driver.mysql (missing) dependents: [service jboss.driver-demander.java:/budget-datasource, service org.wildfly.data-source.budget-datasource]
我使用Eclipse Mars开发p,需要配置项目使用mysql连接器吗?
提前谢谢你的帮助,我很迷茫
我找到了解决方案:
<modue name="javax.api"/>
<module name="javax.api"/>
【问题讨论】:
-
以下建议的解决方案是否有效?
标签: java mysql datasource wildfly wildfly-10