1.启动项目无误,但是访问对应url回显404 找不到资源
重新做pom时缺少了启动依赖
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
2.然后是报This application has no explicit mapping for /error, so you are seeing this as a fallback.
启动类是copy过来的 启动中默认启动的是项目2中的启动类,由于是copy过来的所以名字一样没区分开
我rename了启动类的名字确定是这个信写的启动类启动后就可以正常运行了
3.控制台出现乱码报错
数据库连接配置问题 加上&serverTimezone=UTC
本文解决Spring Boot项目启动时常见的三个问题:访问URL回显404错误,因缺少依赖;显示fallback错误页面,因启动类冲突;控制台出现乱码,因数据库配置问题。通过添加必要依赖、区分启动类名称及正确配置数据库参数,确保项目顺利启动。
2万+

被折叠的 条评论
为什么被折叠?



