您的位置:首页 > 编程语言 > Java开发

解决SpringBoot项目@Autowired注入bean失败的问题

2019-07-18 15:33 4996 查看
版权声明:本文为博主原创文章,遵循 CC 4.0 by-sa 版权协议,转载请附上原文出处链接和本声明。 本文链接:https://blog.csdn.net/qq_33966027/article/details/96432003

 错误信息如下:

[code]***************************
APPLICATION FAILED TO START
***************************

Description:

Field personMapper in com.jymescloud.knmes.service.impl.PersonServiceImpl required a bean of type 'com.jymescloud.knmes.mapper.auto.PersonMapper' that could not be found.

The injection point has the following annotations:
- @org.springframework.beans.factory.annotation.Autowired(required=true)

Action:

Consider defining a bean of type 'com.jymescloud.knmes.mapper.auto.PersonMapper' in your configuration.

经排查发现错误是因为没有配置mapper包的扫描导致的,解决办法是在SpringBoot启动类上添加注解@MapperScan(包地址)

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐