目录

  • 描述
  • 问题
    • 问题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. 完全理解Python迭代对象、迭代器、生成器
  2. Banknote Dataset(钞票数据集)介绍
  3. 在ASP.NET中备份和还原数据库
  4. Asp.net SignalR 应用并实现群聊功能 开源代码
  5. 成功解决for循环语句中,后几次循环输出数据一直全部为空
  6. android小闹钟程序,Android实现闹钟小程序.pdf
  7. THREEJS - 动态标签(texture纹理方式)
  8. footer.php 固定底部,让footer固定在页面(视口)底部
  9. QT-C++ Nesting排料优化,广告,服装,木工排料(支持矩形、异形排版,提高优化效率)
  10. 关于三段式状态机第三段是组合逻辑还是时序逻辑的问题?
  11. 如何网页截长图?网页截图其实很简单
  12. 开放的在线客服系统Live Zilla
  13. 手机测试wifi的延迟的软件,六款最佳、免费的网络延迟测试工具
  14. QT 按钮保持按下时样式
  15. win10忘记密码_Win10系统设置u盘密码的操作过程
  16. 手机屏幕投屏到电脑上是通过什么技术实现的?
  17. 基于Java的网上手机销售系统的设计与实现(附:源码 论文 sql文件 部署视频)
  18. Python微信远程控制摄像头-拍摄女朋友坐电脑前聊天时表情
  19. Golang开发环境搭建
  20. uni-app - H5 网站项目接入集成 51LA 网站统计详细教程(提供 51LA.js 官方插件与引入教程)

热门文章

  1. crsd.log报u_freem: mem passed is null【摘】
  2. 黑科技!Android应用程序双开!!!
  3. Node.js Git Server搭建及Git常用操作笔记
  4. html文件编码怎么修改,html网页乱码怎么修改
  5. Unity3D是什么?
  6. CentOS之——tar.xz结尾的文件的解压方法
  7. 忘记远程Windows系统的密码,使用凭据还原登录系统
  8. mac电脑忘记密码后强制更改登陆密码
  9. 使用BackTrace查看调用堆栈
  10. Reac Hooks