ShardingSphere-JDBC 5.0.0-beta使用:数据源拒绝建立连接,来自服务器的消息:“连接太多”

  • Post author:
  • Post category:其他


问题分析:I wonder if the jar package is missing.This is a non Maven project.

问题处理:调试发现,问题出在少了蛮多依赖包。由于是非maven项目,有些jar包还可能冲突,版本不能向下兼容等问题。jar包引入或少或冲突,仅供参考,此处仅做记录,避免再次采坑。

如所依赖Guava包冲突,冲突解决可参考:


https://blog.csdn.net/u014698745/article/details/119944988

##There are several dependencies not added

avatica-core-1.17.0.jar

calcite-core-1.26.0.jar

calcite-linq4j-1.26.0.jar

commons-compiler-3.0.11.jar

ehcache-2.7.5.jar

esri-geometry-api-2.2.0.jar

failureaccess-1.0.1.jar

guava-29.0-jre.jar

janino-3.0.11.jar

json-path-2.4.0.jar

listenablefuture-9999.0-empty-to-avoid-conflict-with-guava.jar

antlr4-runtime-4.7.2.jar

protobuf-java-3.6.1.jar

##Dependency conflict,just use thisshardingsphere-transaction-core-5.0.0-beta.jar

错误描述:HikariPool循环初始化,导致“java.sql.SQLNonTransientConnectionException: Data source rejected establishment of connection, message from server: “Too many connections”,即数据源拒绝建立连接,来自服务器的消息:“连接太多”

错误异常:

[com.zaxxer.hikari.HikariDataSource]HikariPool-115 – Starting…

[com.zaxxer.hikari.pool.HikariPool]HikariPool-115 – Exception during pool initialization.

java.sql.SQLNonTransientConnectionException: Data source rejected establishment of connection, message from server: “Too many connections”

at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:110)

at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:97)

at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122)

at com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:835)

at com.mysql.cj.jdbc.ConnectionImpl.(ConnectionImpl.java:455)

at com.mysql.cj.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:240)

at com.mysql.cj.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:199)

at com.zaxxer.hikari.util.DriverDataSource.getConnection(DriverDataSource.java:138)



版权声明:本文为u014698745原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。