目录

  • 描述
  • 问题
    • 问题1:Application failed to start with classpath
    • 问题2:Unable to load authentication plugin 'caching_sha2_password'
    • 问题3:The server time zone value 'Öйú±ê׼ʱ¼ä' is unrecognized or represents more than one time zone
    • 警告4:Loading class 'com.mysql.jdbc.Driver'. This is deprecated
  • 小工具推荐
    • YAML、YML在线编辑器(格式化校验)解析工具

描述

说明:

  • 工具:IntelliJ IDEA工具
  • 时间:2021.1.10 @艾伦
  • 记录:搭建好Spring Boot框架及基本配置后,启动Spring Boot项目,结果出现许多问题,在此记录下来,方便日后遇到相关问题时,更好的解决

问题

问题1:Application failed to start with classpath

错误:

15:41:19.809 [main] DEBUG org.springframework.boot.devtools.restart.ChangeableUrls - Matching URLs for reloading : [file:/D:/All_Projects/Blog/Blog_back-IDEA/bolg/target/classes/]
15:41:20.030 [restartedMain] DEBUG org.springframework.boot.logging.ClasspathLoggingApplicationListener - Application failed to start with classpath: [file:/D:/All_Projects/Blog/Blog_back-IDEA/bolg/target/classes/]

具体:

解决:

  • 检查配置文件,发现有错误的冒号,修改即可 低级错误

效果:


问题2:Unable to load authentication plugin ‘caching_sha2_password’

错误:

ERROR 23072 --- [  restartedMain] o.a.tomcat.jdbc.pool.ConnectionPool  : Unable to create initial connections of pool.java.sql.SQLException: Unable to load authentication plugin 'caching_sha2_password'.

具体:

解决:

参考:https://blog.csdn.net/w605283073/article/details/88096598

  • 更新mysql驱动的jar版本,如:修改为8.0.11版本 版本问题

结果:(新问题的解决见→问题3)


问题3:The server time zone value ‘Öйú±ê׼ʱ¼ä’ is unrecognized or represents more than one time zone

新问题:

java.sql.SQLException: The server time zone value 'Öйú±ê׼ʱ¼ä' is unrecognized or represents more than one time zone. You must configure either the server or JDBC driver (via the serverTimezone configuration property) to use a more specifc time zone value if you want to utilize time zone support.

解决:

参考:https://www.pianshen.com/article/3239164549/

  • 在jdbc的连接 url 部分加上 serverTimezone=UTC 时区问题

结果:项目启动成功!!!只出现警告


警告4:Loading class ‘com.mysql.jdbc.Driver’. This is deprecated

参考:https://blog.csdn.net/weixin_42323802/article/details/82500458

警告-1: 驱动弃用

Loading class `com.mysql.jdbc.Driver'.
This is deprecated. The new driver class is `com.mysql.cj.jdbc.Driver'. The driver is automatically registered via the SPI and manual loading of the driver class is generally unnecessary.

具体:

解决-1:

  • 数据库驱动‘com.mysql.jdbc.Driver’已经被弃用,需使用新的驱动com.mysql.cj.jdbc.Driver’
  • 在jdbc的相关配置中,将com.mysql.jdbc.Driver 改为 com.mysql.cj.jdbc.Driver

警告-2: SSL连接

Sun Jan 10 20:49:14 CST 2021 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.

具体:

解决-2:

  • 由于新版的mysql会询问是否SSL连接,并返回一个Boolean值
  • 所以需要手动配置true或false,来告知SSL是否连接(如:useSSL=false)

结果:警告消失


小工具推荐

YAML、YML在线编辑器(格式化校验)解析工具

https://www.toolfk.com/tool-format-yaml


问题|启动Spring Boot报错-4处 @Spring Boot相关推荐

  1. 启动Spring项目报错,Springboot启动报错 Disconnected from the target VM 解决过程

    启动Spring项目报错,Springboot启动报错 Disconnected from the target VM 解决过程 大概率是缺少了一下依赖 <dependency><g ...

  2. 解决Spring Boot报错Mapped Statements collection already contains value for...Error while adding the mapp

    解决Spring Boot报错Mapped Statements collection already contains value for...Error while adding the mapp ...

  3. Spring Cloud的Eureka Server(注册中心)在程序启动的时候报错:Cannot execute request on any known server

    问题描述:Spring Cloud的Eureka Server(注册中心)在程序启动的时候报错:com.netflix.discovery.shared.transport.TransportExce ...

  4. Spring Boot 报错ThreadPoolTaskExecutor : Shutting down ExecutorService ‘applicationTaskExecutor‘

    问题 Spring Boot 报错ThreadPoolTaskExecutor : Shutting down ExecutorService 'applicationTaskExecutor' 原因 ...

  5. springboot 启动的时候报错 Error creating bean with name 'solrClient'

    springboot 启动的时候报错: org.springframework.beans.factory.BeanCreationException: Error creating bean wit ...

  6. FAQ_全志平台Tina3.0.7 RXXX cowbell方案启动时cpufreq报错且无法生成cpufreq节点

    FAQ_全志平台Tina3.0.7 RXXX cowbell方案启动时cpufreq报错且无法生成cpufreq节点 [软件版本]Tina 3.0.7 cowbell方案 [现象] 启动时报错: [ ...

  7. ECLIPSE启动不了,报错org.eclipse.swt.SWTException: Invalid thread access

    春节上班第二天一大早ECLIPSE启动不了,报错 org.eclipse.swt.SWTException: Invalid thread access 打开这个日志文件一看,里面报了一个异常: or ...

  8. 【Linux部署】第一次部署ZooKeeper启动两次报错问题解决 Could not find or load main class+Failed to bind to /0.0.0.0:8080

    使用 zkServer.sh start-foreground 启动可以看到报错信息,使用的时候还是用 zkServer.sh start 来启动服务. 1.第一次安装报错 安装包(apache-zo ...

  9. 启动 docker 容器报错 (iptables failed: iptables --wait -t filter -A DOCKER ! -i docker0 -o docker0

    前言 centos7 phpstudy 1.2 linux 版 启动 docker 容器报错 shell> docker start nexus3 Error response from dae ...

最新文章

  1. 语音识别、传统语音识别、带权有限转态转换器、深度语音识别、时序分类、CTC解码
  2. Java11正式发布了,我们该怎么办?
  3. JAVA多线程中wait()方法的详细分析
  4. ajax不能访问本地php文件,php – 使用htaccess拒绝ajax文件访问
  5. Docker安装ActiveMQ(docker-compose.yml)
  6. java访问对象的属性_java访问对象的属性和行为详细介绍
  7. 零成本兼职副业有哪些?
  8. pytorch ResNet结构代码实现
  9. PHP期望T_PAAMAYIM_NEKUDOTAYIM?
  10. 我的计时软件TimeDogV13
  11. icem二维非结构网格划分_“白皮书”系列No.26——科研小工具之ICEM
  12. HttpSession概述
  13. 为什么说采购一定要成为专家
  14. MIPI扫盲系列博文
  15. mysql 5.7 压缩包解压安装过程
  16. (150)FPGA面试题-Verilog实现2的幂次方乘法运算
  17. java 约瑟夫单循环_约瑟夫问题(Josephus问题)的递推O(n)解法、循环解法、单循环链表解法 | 学步园...
  18. 前瞻性队列、回顾性队列、病例对照研究
  19. 20种富含维生素A的食物盘点,赶紧保存收藏!
  20. 关于Latex中生僻字显示问题

热门文章

  1. 蓝牙耳机什么牌子好?500内好用的蓝牙耳机推荐
  2. 国内量化交易现状总结
  3. 使用ssh或者scp时指定密码
  4. 数据结构考研笔记(十八) ——图的基本操作
  5. 关于java实现十进制转换为任意进制
  6. uniapp—— uni统计2.0接入记录及问题解决
  7. 公路施工过程中作业重点和技术完善
  8. 上门家教预约小程序开发 良师就在你身边
  9. Flutter的绘制剖析——图形库skia
  10. 平面设计心得分享——入门学习应该注意什么