实战Spring Boot开发常见错误及解决办法

本文主要探讨了Spring Boot开发中遇到的常见问题,包括端口被占用、YML配置文件更改端口、MySQL版本问题、时区设置、启动类扫描、Maven操作以及Swagger和@RestController的使用误区,提供了解决这些问题的具体步骤和建议。

Failed to start component [Connector[HTTP/1.1-80]]::端口被占用,yml配置文件更改端口
3TGCQF25BLHU9R7IQUITN0FCC5
CLIENT_PLUGIN_AUTH is required] with root cause :MySQL版本问题,pom更改版本依赖
useUnicode=true&characterEncoding=utf-8 :设定时区时,serverTimezone=UTC比中国时间早8个小时,若在中国,可设置serverTimezone=Shanghai或者serverTimezone=Hongkong,例如:
driverClassName=com.mysql.cj.jdbc.Driver url=jdbc:mysql://localhost:3306/test?serverTimezone=Shanghai&?useUnicode=true&characterEncoding=utf8&useSSL=false username=root password=root

Error creating bean with name 'userController'启动类架包扫描@ComponentScan(basePackages = { "com.example.controller" }) Field userServiceImpl in com.hxz.controller.UserController required a bean of type 'com.hxz.service. @ComponentScan(basePackages = { "com.example.service.impl })

The Tomcat connector configured to listen on port 8081 failed to

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值