A component required a bean of type 'com.example...' that could not be found解决办法

工程启动报错
A component required a bean of type ‘com.example…’ that could not be found

 

解决办法一:
1、再启动类添加mapper包扫描注解即可
@MapperScan(“com.example.firstspringboot.dao”)
在这里插入图片描述

解决办法二:
在每个mapper接口上添加@mapper注解
在这里插入图片描述

 

转载自:https://blog.csdn.net/qq_34206683/article/details/86179789

猜你喜欢

转载自www.cnblogs.com/LinQingYang/p/12335979.html