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

启动工程后控制台报错显示A component required a bean of type ‘com.example.demo2.dao.AdminDao’ that could not be found.

解决办法:

方法一:在每个mapper接口上添加上注解@Mapper
方法二:在Demo2Application.java文件中添加注解@Mapper Scan(“这里填入mapper接口的路径”)
A component required a bean of type ‘com.example...‘ that could not be found解决办法

相关文章: