gpt4 book ai didi

java - Wildfly 10 无法连接数据源 : invalid connection

转载 作者:塔克拉玛干 更新时间:2023-11-03 05:16:20 25 4
gpt4 key购买 nike

问题

我正在尝试测试我的连接,它一直给我同样的错误,而乍一看我看不出我做错了什么。也许我忽略了一些东西......

错误

    nexpected HTTP response: 500

Request
{
"address" => [
("subsystem" => "datasources"),
("data-source" => "ProjectenDS")
],
"operation" => "test-connection-in-pool"
}

Response

Internal Server Error
{
"outcome" => "failed",
"failure-description" => "WFLYJCA0040: failed to invoke operation: WFLYJCA0047: Connection is not valid",
"rolled-back" => true
}


Standalone-full.xml

    <subsystem xmlns="urn:jboss:domain:datasources:4.0">
<datasources>
<datasource jta="true" jndi-name="java:/ProjectenDS" pool-name="ProjectenDS" enabled="true" use-ccm="true">
<connection-url>jdbc:mysql://localhost:3306/projecten3db</connection-url>
<driver-class>com.mysql.jdbc.Driver</driver-class>
<driver>mysql-connector-java-5.1.40-bin.jar_com.mysql.jdbc.Driver_5_1</driver>
<pool>
<min-pool-size>10</min-pool-size>
<initial-pool-size>11</initial-pool-size>
<max-pool-size>100</max-pool-size>
</pool>
<security>
<user-name>projecten</user-name>
<password>projecten</password>
</security>
<validation>
<valid-connection-checker class-name="org.jboss.jca.adapters.jdbc.extensions.mysql.MySQLValidConnectionChecker"/>
<background-validation>true</background-validation>
<exception-sorter class-name="org.jboss.jca.adapters.jdbc.extensions.mysql.MySQLExceptionSorter"/>
</validation>
</datasource>
</datasources>
</subsystem>

最佳答案

您遇到的异常是通用的。

检查 {WILDFLY_HOME}/standalone/log/server.log

在 Web 控制台上测试时,您可以使用 tail -f server.log

这将为您提供正确的错误。

关于java - Wildfly 10 无法连接数据源 : invalid connection,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40538343/

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