使用Idea搭建Springboot项目-bug记录

it2026-01-24  7

首先感谢这篇非常非常优秀的博客。对于初学Springboot的同学这可以作为第一个springboot的实战小项目,非常详尽。

因为这篇文章是作者之前写的,对于Idea和一些依赖库的版本更新可能又会出现新的bug。

我这里记录了我出现的bug及解决方法。

【我的版本说明】

Idea 2020.1.3社区版

maven: 3.6.1非idea自带,是我自己配置的

mysql: 8.0.21

依赖:

1.报“Whitelabel Error Page This application has no ·····”

解决:在pom.xml中添加thymeleaf依赖。

<!--我自己添加的Thymeleaf依赖 --> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-thymeleaf</artifactId> </dependency>

2.File-Settings-Plugins-Marketplace搜索安装插件,结果显示nothing found或者显示check Internet···

解决:如果显示check Internet ···loads,那么切换网络,使用VPN;

如果显示nothing found,那么关掉Idea,重启。(我的就是这么好的,很神奇吧O(∩_∩)O)

3.在Idea中找不到Database。(长的和maven差不多,都是出现在侧边的,可是我没有)

解决:

方法一:View-Tool Windows-Database就找到了     (我的Idea这种方法没找到,遂尝试下一种方法)

方法二:File-Settings-Plugins-Marketplace搜索database ,我下载的是Database Navigator,它下的最多,所以我也下的这个:)

下载好了之后打开View-Tool Windows-DB browser

4.DB Navigator连接数据库(即点击Test connection)时,报The server time zone value ‘�й���׼ʱ��‘ is unrecognized or represents...

解决:在application.yml中url:jdbc:mysql应写成如下形式,其中“test”可自行更改成对应的网址链接子路径

url: jdbc:mysql://localhost:3306/test?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=UTC&allowPublicKeyRetrieval=true

虽然这样改,但是还是报同样的错误的话,那么

* 打开mysql

* 依次输入如下代码

mysql>set global time_zone = '+8:00'; mysql>flush privileges; mysql>show variables like '%time_zone%';

5.报“Application failed to start with classpath:·····”

解决:删除application.yml文件中的中文注解。

6.运行Test测试类时,报“警告:Runner org.junit.internal.runners.ErrorReportingRunner (used on class com.example.test1.Test1ApplicationTests) does not support filtering and will therefore be run complet”

解决:在Test测试类中把import org.junit.jupiter.api.Test;替换为import org.junit.Test;

以上就是我在复现小项目时遇到的一些问题整理。

看,我真的跑出来了,hhhhhhhh!超开心😊

最新回复(0)