课设进行到末尾,使用过程中遇到了一些错误,这里记录一下
Failed to start component [Connector[HTTP/1.1-80]]::
端口被占用,yml配置文件更改端口CLIENT_PLUGIN_AUTH is required] with root cause
:MySQL版本问题,pom更改版本依赖useUnicode=true&characterEncoding=utf-8 :
设定时区时,serverTimezone=UTC
比中国时间早8个小时,
若在中国,可设置serverTimezone=Shanghai
或者serverTimezone=Hongkong
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 start. The port may already be in use or the connector may be misconfigured.
更改端口号错误: 找不到或无法加载主类 com.hxz.SpringBootBlogApplication :右击pom,
选择maven clean再点击maven installspringboot 控制台debug sql
logging.level.com.hxz.mapper=debug
其中logging.level.com.你的Mapper包=日志等级attempted to return null from a method with a primitive return type (int).
mapper文件返回值问题,注意是int还是String类型Unable to infer base url. This is common when using dynamic servlet registration or when the API is
(swagger错误)启动类加EnableSwagger2注解springboot集成thymeleaf中遇到不能返回页面,只返回字符串。
原因:在controller中使用了注解@RestController修改:修改注解为@Controller- `io.lettuce.core.RedisCommandTimeoutException: Command timed out
连接超时时间设置的过于短暂(我这边设置成了0),修改为5000左右即可
(spring.redis.timeout=50000)
`