异常如下:

  1. Exception in thread "pool-3-thread-2" org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.exceptions.PersistenceException:
  2. ### Error updating database. Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
  3. The last packet successfully received from the server was 1,610 milliseconds ago. The last packet sent successfully to the server was 1,583 milliseconds ago.
  4. ### Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
  5. The last packet successfully received from the server was 1,610 milliseconds ago. The last packet sent successfully to the server was 1,583 milliseconds ago.
  6. at org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:77)
  7. at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:446)
  8. at com.sun.proxy.$Proxy59.insert(Unknown Source)
  9. at org.mybatis.spring.SqlSessionTemplate.insert(SqlSessionTemplate.java:278)
  10. at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:58)
  11. at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:59)
  12. at com.sun.proxy.$Proxy68.insertSelectiveList(Unknown Source)
  13. at com.gwd.movie.service.impl.AnalyzeMovieHtmlServiceImpl.getView(AnalyzeMovieHtmlServiceImpl.java:111)
  14. at com.gwd.movie.service.impl.AnalyzeMovieHtmlServiceImpl.getDoc(AnalyzeMovieHtmlServiceImpl.java:127)
  15. at com.gwd.movie.service.impl.AnalyzeMovieHtmlServiceImpl.getTitleDetailUrl(AnalyzeMovieHtmlServiceImpl.java:214)
  16. at com.gwd.movie.service.impl.AnalyzeMovieHtmlServiceImpl$1.run(AnalyzeMovieHtmlServiceImpl.java:189)
  17. at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
  18. at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
  19. at java.lang.Thread.run(Unknown Source)
  20. Caused by: org.apache.ibatis.exceptions.PersistenceException:
  21. ### Error updating database. Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
  22. The last packet successfully received from the server was 1,610 milliseconds ago. The last packet sent successfully to the server was 1,583 milliseconds ago.
  23. ### Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
  24. The last packet successfully received from the server was 1,610 milliseconds ago. The last packet sent successfully to the server was 1,583 milliseconds ago.
  25. at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:30)
  26. at org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession.java:200)
  27. at org.apache.ibatis.session.defaults.DefaultSqlSession.insert(DefaultSqlSession.java:185)
  28. at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  29. at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
  30. at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
  31. at java.lang.reflect.Method.invoke(Unknown Source)
  32. at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:433)
  33. ... 12 more
  34. Caused by: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
  35. The last packet successfully received from the server was 1,610 milliseconds ago. The last packet sent successfully to the server was 1,583 milliseconds ago.
  36. at org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:81)
  37. at org.mybatis.spring.transaction.SpringManagedTransaction.openConnection(SpringManagedTransaction.java:82)
  38. at org.mybatis.spring.transaction.SpringManagedTransaction.getConnection(SpringManagedTransaction.java:68)
  39. at org.apache.ibatis.executor.BaseExecutor.getConnection(BaseExecutor.java:338)
  40. at org.apache.ibatis.executor.SimpleExecutor.prepareStatement(SimpleExecutor.java:84)
  41. at org.apache.ibatis.executor.SimpleExecutor.doUpdate(SimpleExecutor.java:49)
  42. at org.apache.ibatis.executor.BaseExecutor.update(BaseExecutor.java:117)
  43. at org.apache.ibatis.executor.CachingExecutor.update(CachingExecutor.java:76)
  44. at org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession.java:198)
  45. ... 18 more
  46. Caused by: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
  47. The last packet successfully received from the server was 1,610 milliseconds ago. The last packet sent successfully to the server was 1,583 milliseconds ago.
  48. at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
  49. at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
  50. at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
  51. at java.lang.reflect.Constructor.newInstance(Unknown Source)
  52. at com.mysql.jdbc.Util.handleNewInstance(Util.java:425)
  53. at com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:990)
  54. at com.mysql.jdbc.ExportControlled.transformSocketToSSLSocket(ExportControlled.java:201)
  55. at com.mysql.jdbc.MysqlIO.negotiateSSLConnection(MysqlIO.java:4914)
  56. at com.mysql.jdbc.MysqlIO.proceedHandshakeWithPluggableAuthentication(MysqlIO.java:1663)
  57. at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1224)
  58. at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2199)
  59. at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2230)
  60. at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2025)
  61. at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:778)
  62. at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:47)
  63. at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
  64. at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
  65. at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
  66. at java.lang.reflect.Constructor.newInstance(Unknown Source)
  67. at com.mysql.jdbc.Util.handleNewInstance(Util.java:425)
  68. at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:386)
  69. at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:330)
  70. at com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnection(DruidAbstractDataSource.java:1408)
  71. at com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnection(DruidAbstractDataSource.java:1464)
  72. at com.alibaba.druid.pool.DruidDataSource.init(DruidDataSource.java:684)
  73. at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:991)
  74. at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:987)
  75. at com.alibaba.druid.pool.DruidDataSource.getConnection(DruidDataSource.java:103)
  76. at org.springframework.jdbc.datasource.DataSourceUtils.fetchConnection(DataSourceUtils.java:151)
  77. at org.springframework.jdbc.datasource.DataSourceUtils.doGetConnection(DataSourceUtils.java:115)
  78. at org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:78)
  79. ... 26 more
  80. Caused by: javax.net.ssl.SSLException: java.lang.SecurityException: JCE cannot authenticate the provider SunJCE
  81. at sun.security.ssl.Alerts.getSSLException(Unknown Source)
  82. at sun.security.ssl.SSLSocketImpl.fatal(Unknown Source)
  83. at sun.security.ssl.SSLSocketImpl.fatal(Unknown Source)
  84. at sun.security.ssl.SSLSocketImpl.handleException(Unknown Source)
  85. at sun.security.ssl.SSLSocketImpl.startHandshake(Unknown Source)
  86. at sun.security.ssl.SSLSocketImpl.startHandshake(Unknown Source)
  87. at com.mysql.jdbc.ExportControlled.transformSocketToSSLSocket(ExportControlled.java:186)
  88. ... 50 more
  89. Caused by: java.lang.SecurityException: JCE cannot authenticate the provider SunJCE
  90. at javax.crypto.Cipher.getInstance(Cipher.java:657)
  91. at java.security.Signature$Delegate.newInstance(Unknown Source)
  92. at java.security.Signature$Delegate.chooseProvider(Unknown Source)
  93. at java.security.Signature$Delegate.engineInitVerify(Unknown Source)
  94. at java.security.Signature.initVerify(Unknown Source)
  95. at sun.security.ssl.RSASignature.engineInitVerify(Unknown Source)
  96. at java.security.Signature$Delegate.init(Unknown Source)
  97. at java.security.Signature$Delegate.chooseProvider(Unknown Source)
  98. at java.security.Signature$Delegate.engineInitVerify(Unknown Source)
  99. at java.security.Signature.initVerify(Unknown Source)
  100. at sun.security.ssl.HandshakeMessage$DH_ServerKeyExchange.<init>(Unknown Source)
  101. at sun.security.ssl.ClientHandshaker.processMessage(Unknown Source)
  102. at sun.security.ssl.Handshaker.processLoop(Unknown Source)
  103. at sun.security.ssl.Handshaker.process_record(Unknown Source)
  104. at sun.security.ssl.SSLSocketImpl.readRecord(Unknown Source)
  105. at sun.security.ssl.SSLSocketImpl.performInitialHandshake(Unknown Source)
  106. ... 53 more
  107. Caused by: java.util.jar.JarException: Class is on the bootclasspath
  108. at javax.crypto.JarVerifier.verify(JarVerifier.java:286)
  109. at javax.crypto.JceSecurity.verifyProviderJar(JceSecurity.java:164)
  110. at javax.crypto.JceSecurity.getVerificationResult(JceSecurity.java:190)
  111. at javax.crypto.Cipher.getInstance(Cipher.java:653)
  112. ... 68 more
  113. Sun Oct 21 16:25:41 CST 2018 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.
  114. Sun Oct 21 16:25:42 CST 2018 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.
  115. Sun Oct 21 16:25:42 CST 2018 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.
  116. Sun Oct 21 16:25:42 CST 2018 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.

解决方案:

spring.datasource.url=jdbc:mysql://xx.xx.xx.xx/XX?characterEncoding=UTF-8

加上&useSSL=false

spring.datasource.url=jdbc:mysql:/xx.xx.xx.xx/XX?characterEncoding=UTF-8&useSSL=false

CannotGetJdbcConnectionException:Failed to obtain JDBC Connection相关推荐

  1. org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested

    org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested ...

  2. org.springframework.jdbc.CannotGetJdbcConnectionException Failed to obtain JDBC Connection

    org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection:nested e ...

  3. 【环境问题】基础Web环境搭建问题记录2——Failed to obtain JDBC Connection;

    环境: MacBook Pro 15 jdk8 IntelliJ IDEA 基础Web框架:Spring+SpringMVC+MyBatis+MySQL+Maven 问题: Error queryin ...

  4. Failed to obtain JDBC Connection; nested exception is com.mysql.cj.jdbc.exceptions.CommunicationsEx

    我的是再宿主机连接虚拟机的时候报的这个错 The last packet sent successfully to the server was 0 milliseconds ago. The dri ...

  5. IDEA报错:Failed to obtain JDBC ConnectionCannot create PoolableConnectionFactory

    数据库连接错误 数据库连接失败Cannot create PoolableConnectionFactory (Communications link failure 解决: 简单检查 url, us ...

  6. Failed to obtain JDBC Connection; nested exception is java.sql.SQLException: com.mysql.cj.jdbc.Driv

    解答 这种情况常见于直接打开jsp页面时ide报错,主要原因是不同意html这个静态页面,jsp它本身的特性导致其需要在运行的服务端下才可以打开. 所以打开前需要先启动tomcat等一类服务器,在服务 ...

  7. caddy 获取SSL证书报错解决:failed to obtain certificate: acme: Error - One or more domains had a problem

    此文首发于我的Jekyll博客:zhang0peter的个人博客 早上尝试使用caddy,启动HTTPS服务,并自动配置TLS证书,结果在自动配证书的过程中报错: -> # sudo syste ...

  8. quartz异常:Couldn't rollback jdbc connection

    为什么80%的码农都做不了架构师?>>>    最近工作发现,有个项目偶尔会报Couldn't rollback jdbc connection. No operations all ...

  9. docker启动es报错:failed to obtain node locks...

    在学习es时,使用docker启动时发现一直报错: java.lang.IllegalStateException: failed to obtain node locks, tried [[/usr ...

  10. IDEA连接数据库时报错org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection

    IDEA连接数据库的记录 各种看不懂的错 org.springframework.test.context.support.DefaultTestContextBootstrapper getTest ...

最新文章

  1. 洛谷P1896 [SCOI2005]互不侵犯 状压dp+位运算
  2. 手机内存RAM、ROM简介
  3. 居然又要出一部关于程序员的剧!你会追么?
  4. vb 获取汉字拼音的首字母
  5. windows 查看网络中断事件_等保测评2.0:Windows安全审计
  6. tensorflow英语怎么读_英语不行?你可以试试TensorFlow官方中文版教程
  7. WPF RichTextBox 控件常用方法和属性
  8. winform 文件上传限制文件类型及文件大小
  9. 就这么简单!构建强大的WebShell防护体系
  10. cookie被淘汰_可爱可恨的 Cookie
  11. pytorch版crnn网络框架
  12. C++sort函数使用(成绩排名)
  13. problems encountered during text search
  14. 把两个数和告诉A,积告诉B,A说不知道是多少, B也说不知道,这时A说我知道了, B接着说我也知道了,求这两个数是什么
  15. 小白兔写话_小白兔写话二年级作文
  16. Modelsim与debussy联合仿真
  17. 电商怎么起号做直播带货需要注意什么
  18. 实现IE6、IE7、IE8多版本浏览器共存
  19. 机器视觉VS计算机视觉
  20. SiC MOSFET驱动电压的分析

热门文章

  1. C/C++犯二程度计算
  2. 那些年我们一起犯二的青春--IGRSS--2015--1th
  3. 神经元的细胞体内有什么,神经元的细胞体在哪里
  4. Web移动端混合开发--IonicFramework
  5. 计算机键盘按键数量,电脑键盘有一百多个按键,有3个很少人会碰
  6. python新版个人所得税代码_python-计算个人所得税(示例代码)
  7. 开源的远程桌面软件RustDesk
  8. Google+ about Gmail?
  9. 蓝桥杯 算法训练 寂寞的数
  10. 2020科目一考试口诀_2020驾考技巧科目一考试口诀答题法