c3p0连接数据库时报错,连接不上Communications link failure
来源:互联网 发布:如何禁止某个软件运行 编辑:程序博客网 时间:2024/05/29 18:14
具体错误如下:
[2017-08-10 15:14:40|WARN |com.mchange.v2.resourcepool.BasicResourcePool] - com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@6cde6d8b -- Acquisition Attempt Failed!!! Clearing pending acquires. While trying to acquire a needed new resource, we failed to succeed more than the maximum number of allowed acquisition attempts (10). Last acquisition attempt exception: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failureThe last packet successfully received from the server was 15 milliseconds ago. The last packet sent successfully to the server was 15 milliseconds ago. at sun.reflect.GeneratedConstructorAccessor53.newInstance(Unknown Source) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:423) at com.mysql.jdbc.Util.handleNewInstance(Util.java:404) at com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:988) at com.mysql.jdbc.ExportControlled.transformSocketToSSLSocket(ExportControlled.java:164) at com.mysql.jdbc.MysqlIO.negotiateSSLConnection(MysqlIO.java:4894) at com.mysql.jdbc.MysqlIO.proceedHandshakeWithPluggableAuthentication(MysqlIO.java:1661) at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1228) at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2253) at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2284) at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2083) at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:806) at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:47) at sun.reflect.GeneratedConstructorAccessor50.newInstance(Unknown Source) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:423) at com.mysql.jdbc.Util.handleNewInstance(Util.java:404) at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:410) at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:328) at com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(DriverManagerDataSource.java:134) at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:182) at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:171) at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.acquireResource(C3P0PooledConnectionPool.java:137) at com.mchange.v2.resourcepool.BasicResourcePool.doAcquire(BasicResourcePool.java:1014) at com.mchange.v2.resourcepool.BasicResourcePool.access$800(BasicResourcePool.java:32) at com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask.run(BasicResourcePool.java:1810) at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:547)
博主出现这个错误的原因是因为以前用低版本的jdbc连接高版本的数据库时,加上过这样一句useSSL=true
,现在数据库版本改变了,然后就报错了,找了很久。最后发现去掉这个就可以了。
连接url变为:db.url=jdbc:mysql://localhost:3306/xxx?characterEncoding=utf8
阅读全文
0 0
- c3p0连接数据库时报错,连接不上Communications link failure
- 连接数据库报错 Communications link failure
- java工程连接远程MySQL数据库报错:Communications link failure due to underlying exception
- MySQL连接超时Communications link failure
- MySQL连接超时Communications link failure
- sqoop连接mysql出现 Communications link failure
- 解决“连接数据库是老是报Communications link failure due to underlying exception”
- tomcat中报错Communications link failure。数据库链接和mybatis连接池问题
- 远程连接mysql的“Communications link failure”错误解决方案
- Hibernate连接池维护mysql异常:Communications link failure
- MySQL连接池“Communications link failure”的问题
- com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure连接报错解决方法之一
- javaweb,数据库链接问题Communications link failure
- 解决MySQL连接超时Communications link failure due to underlying exception
- 解决MySQL连接超时Communications link failure due to underlying exception
- 解决MySQL连接超时Communications link failure due to underlying exception
- 解决MySQL连接超时Communications link failure due to underlying exception
- 解决MySQL连接超时Communications link failure due to underlying exception
- IntelliJ 相关产品注册码
- VS2010 C#中实现在调用第三方ocx控件时,无需手动注册ocx控件
- 最新最全Java面试知识点总结
- 汇编学习笔记1
- 单链表逆转
- c3p0连接数据库时报错,连接不上Communications link failure
- Lottie- 让Android动画实现更简单
- laravel笔记-验证
- 数据结构学习笔记1
- osg 模型显示不全,闪烁问题
- linux下如何安装matlab
- Illegal key size -Java
- Java设计模式——原型模式
- App 审核被拒 2. 1 Performance: App Completeness