required a bean of type 'com.zhb.dao.StudentDao' that could not be found.

1、在书写Springboot练习的时候报错,检查mybatis的配置文件并未发现错误,采用的是springoot+mybatis

配置文件:已经配置了接口的实现

 在Controller中也已经注入了studentdao

 

2、解决方案

在启动类中添加注解,扫描配置文件

 测试结果:无报错

 

posted @ 2020-09-19 14:39  怀梦想,致远方  阅读(642)  评论(0编辑  收藏  举报