环境情况,MySQL版本如下:

报错情况如下(看上去是和数据库有关):

com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure

The last packet successfully received from the server was 59 milliseconds ago.  The last packet sent successfully to the server was 59 milliseconds ago.
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[na:1.8.0_275]
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) ~[na:1.8.0_275]
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[na:1.8.0_275]
at java.lang.reflect.Constructor.newInstance(Constructor.java:423) ~[na:1.8.0_275]
at com.mysql.jdbc.Util.handleNewInstance(Util.java:425) ~[mysql-connector-java-5.1.47.jar:5.1.47]
at com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:990) ~[mysql-connector-java-5.1.47.jar:5.1.47]
at com.mysql.jdbc.ExportControlled.transformSocketToSSLSocket(ExportControlled.java:201) ~[mysql-connector-java-5.1.47.jar:5.1.47]
at com.mysql.jdbc.MysqlIO.negotiateSSLConnection(MysqlIO.java:4914) ~[mysql-connector-java-5.1.47.jar:5.1.47]
at com.mysql.jdbc.MysqlIO.proceedHandshakeWithPluggableAuthentication(MysqlIO.java:1663) ~[mysql-connector-java-5.1.47.jar:5.1.47]
at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1224) ~[mysql-connector-java-5.1.47.jar:5.1.47]
at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2199) ~[mysql-connector-java-5.1.47.jar:5.1.47]
at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2230) ~[mysql-connector-java-5.1.47.jar:5.1.47]
at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2025) ~[mysql-connector-java-5.1.47.jar:5.1.47]
at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:778) ~[mysql-connector-java-5.1.47.jar:5.1.47]
at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:47) ~[mysql-connector-java-5.1.47.jar:5.1.47]
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[na:1.8.0_275]
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) ~[na:1.8.0_275]
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[na:1.8.0_275]
at java.lang.reflect.Constructor.newInstance(Constructor.java:423) ~[na:1.8.0_275]
at com.mysql.jdbc.Util.handleNewInstance(Util.java:425) ~[mysql-connector-java-5.1.47.jar:5.1.47]
at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:386) ~[mysql-connector-java-5.1.47.jar:5.1.47]
at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:330) ~[mysql-connector-java-5.1.47.jar:5.1.47]
at com.alibaba.druid.filter.FilterChainImpl.connection_connect(FilterChainImpl.java:156) ~[druid-1.2.3.jar:1.2.3]
at com.alibaba.druid.filter.FilterAdapter.connection_connect(FilterAdapter.java:787) ~[druid-1.2.3.jar:1.2.3]
at com.alibaba.druid.filter.FilterEventAdapter.connection_connect(FilterEventAdapter.java:38) ~[druid-1.2.3.jar:1.2.3]
at com.alibaba.druid.filter.FilterChainImpl.connection_connect(FilterChainImpl.java:150) ~[druid-1.2.3.jar:1.2.3]
at com.alibaba.druid.filter.FilterAdapter.connection_connect(FilterAdapter.java:787) ~[druid-1.2.3.jar:1.2.3]
at com.alibaba.druid.filter.FilterChainImpl.connection_connect(FilterChainImpl.java:150) ~[druid-1.2.3.jar:1.2.3]
at com.alibaba.druid.filter.stat.StatFilter.connection_connect(StatFilter.java:227) ~[druid-1.2.3.jar:1.2.3]
at com.alibaba.druid.filter.FilterChainImpl.connection_connect(FilterChainImpl.java:150) ~[druid-1.2.3.jar:1.2.3]
at com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnection(DruidAbstractDataSource.java:1654) ~[druid-1.2.3.jar:1.2.3]
at com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnection(DruidAbstractDataSource.java:1718) ~[druid-1.2.3.jar:1.2.3]
at com.alibaba.druid.pool.DruidDataSource$CreateConnectionThread.run(DruidDataSource.java:2785) ~[druid-1.2.3.jar:1.2.3]
Caused by: javax.net.ssl.SSLHandshakeException: Received fatal alert: protocol_version
at sun.security.ssl.Alert.createSSLException(Alert.java:131) ~[na:1.8.0_275]
at sun.security.ssl.Alert.createSSLException(Alert.java:117) ~[na:1.8.0_275]
at sun.security.ssl.TransportContext.fatal(TransportContext.java:311) ~[na:1.8.0_275]
at sun.security.ssl.Alert$AlertConsumer.consume(Alert.java:293) ~[na:1.8.0_275]
at sun.security.ssl.TransportContext.dispatch(TransportContext.java:185) ~[na:1.8.0_275]
at sun.security.ssl.SSLTransport.decode(SSLTransport.java:149) ~[na:1.8.0_275]
at sun.security.ssl.SSLSocketImpl.decode(SSLSocketImpl.java:1143) ~[na:1.8.0_275]
at sun.security.ssl.SSLSocketImpl.readHandshakeRecord(SSLSocketImpl.java:1054) ~[na:1.8.0_275]
at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:394) ~[na:1.8.0_275]
at com.mysql.jdbc.ExportControlled.transformSocketToSSLSocket(ExportControlled.java:186) ~[mysql-connector-java-5.1.47.jar:5.1.47]
... 26 common frames omitted

网上查找了很多方法都没有效果,应该是与我的问题无关,我仔细观察最后的真正的错误原因

Caused by: javax.net.ssl.SSLHandshakeException: Received fatal alert: protocol_version

于是我猜想是MySQL驱动的问题,于是我将驱动依赖改为了如下

<!--数据库-->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.49</version>
</dependency>xml

原先的是5.1.47报错了,改成上面的版本就可以了正常启动springboot的项目了

springboot项目启动报错Communications link failure的更多相关文章

  1. springboot项目启动报错Failed to configure a DataSource: &#39;url&#39; attribute is not specified and no embedde

    springboot项目启动报错Failed to configure a DataSource: 'url' attribute is not specified and no embedde 创建 ...

  2. SpringBoot项目启动报错:java.lang.RuntimeException: java.lang.reflect.InvocationTargetException

    .   ____          _            __ _ _ /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \( ( )\___ | '_ | '_| | ...

  3. Springboot项目启动报错,提示Cannot determine embedded database driver class for database type NONE

    我在springboot项目里面引入了数据库的配置: <dependency> <groupId>org.mybatis.spring.boot</groupId> ...

  4. springboot项目启动报错

    启动springboot项目报错: NoSuchMethodError: org.apache.tomcat.util.scan.StandardJarScanner.setJarScanFilter ...

  5. springboot项目启动报错 url&#39; attribute is not specified and no embedded datasource could be configured

    报错相关信息: 2019-07-22 17:12:48.971 ERROR 8312 --- [ main] o.s.b.d.LoggingFailureAnalysisReporter : **** ...

  6. 解决:eclipse配置Database Connections报错Communications link failure Last packet sent to the server was 0 ms ago

    网上各式各样的问题,不过我的问题在于我开了Proxifier,导致链接localhost的时候被拦截...把Proxifier关了就好了 以后遇到这种问题.连不上数据库啊,连不上本地的服务器啊,先检查 ...

  7. springboot项目启动报错 Failed to configure a DataSource: &#39;url&#39; attribute is not specified and no embedde

    参考:https://blog.csdn.net/Coyotess/article/details/80637837

  8. Linux下Tomcat项目启动报错

    Linux下Tomcat项目启动报错 org.springframework.beans.factory.CannotLoadBeanClassException: Error loading cla ...

  9. Springboot 之 启动报错-Cannot determine embedded database driver class for database type NONE

    Springboot 之 启动报错-数据库 springboot项目在启动时,报如下错误: Error starting ApplicationContext. To display the auto ...

随机推荐

  1. 计数排序(counting-sort)&mdash;&mdash;算法导论(9)

    1. 比较排序算法的下界 (1) 比较排序     到目前为止,我们已经介绍了几种能在O(nlgn)时间内排序n个数的算法:归并排序和堆排序达到了最坏情况下的上界:快速排序在平均情况下达到该上界.   ...

  2. [Java] 特殊正则-替换字符串

    public class Test { public static void main(String[] args) { String str = "2412rhttp://192.168. ...

  3. bitmap的图像像素遍历方法

    public class FastBitmap { BitmapData bitmapData; public FastBitmap(Bitmap bitmap) { ,,bitmap.Width,b ...

  4. Android提高篇之自定义dialog实现processDialog“正在加载”效果、使用Animation实现图片旋转

     知识点: 1.使用imageview.textview自定义dialog 2.使用Animation实现图片旋转动画效果 3.通过自定义theme去掉dialog的title 没有使用progres ...

  5. android http 通信(java原生类库实现)

    get方式 private void doGet(){ URL httpurl = new URl(url); HttpURLConnection conn = (HttpURLConnection) ...

  6. HttpClient--HttpGet使用

    最近公司在做一个爬虫工具,爬取公司现网的数据,留给方通项目使用 用到里阿帕奇的这两个类,在网上看到了一些资料结合自己的应用,这个贴出一个demo import com.alibaba.fastjson ...

  7. HTML style基础2

    2017.0807 晴 style 样式实例 背景颜色  font-family: '.PingFang SC';">背景颜色 标题<h2 style=" font-f ...

  8. 7.5 GRASP原则五:高内聚 High Cohesion

    GRASP原则五:高内聚 High Cohesion  How to keep objects focused, understandable and manageable, and as a si ...

  9. hdu 3910 Liang Guo Sha

    题目链接:hdu 3910 Liang Guo Sha 题目大意:Alice和Bob这两个小伙伴又发明了一种新游戏, 叫两国杀, 每个人手上有两张牌,“杀” 和“闪”, 然后有三个数值A,B和C, 当 ...

  10. springMVC流程分析

    下面是DispatcherServlet的doDispatch()方法 protected void doDispatch(HttpServletRequest request, HttpServle ...