SpringBoot 2.0提示报错使用指南

2018-05-29  本文已影响59人  如风_周

1 mybatis提示报错

Description:
A component required a bean of type 'com.example.demo.dao.UserInfoMapper' that could not be found.
Action:
Consider defining a bean of type 'com.example.demo.dao.UserInfoMapper' in your configuration.

解决方法:
需要在调用的mybatis里加入 注解 @Mapper 相关连接

2 请求
请求返回json格式,需要加上@RequestBody,否则会报错
3 windows- mysql数据库连接
mysql can't get hostname for your address
解决方法: 在本地服务管理mySql更改为本地服务(默认是网络服务)
4 mysql
Public Key Retrieval is not allowed
解决办法:
需要在连接地址后加上 allowPublicKeyRetrieval=true 相关连接
5 @AutoWired
Could not autowire. No beans 'here name' type found
解决办法:
实例化并继承接口

TIM图片20180602212635.png
上一篇 下一篇

猜你喜欢

热点阅读