您的位置: 首页 > 文章 > SSM框架Could not autowire. No beans of UserDao type found SSM框架Could not autowire. No beans of UserDao type found 分类: 文章 • 2023-04-08 13:12:45 问题 Service层通过@Autowired注解注入Dao层接口时提示Could not autowire. No beans of ‘UserDao’ type found 改用@Resource注解注入时正常: 检查自己的配置文件中配置扫描Dao接口包的路径是否正确 我这里的配置是写在spring-mybatis.xml中的,可以看到我项目的路径为:com.shu.dao,而配置文件中的value值为com.hsf.dao,因为这个配置文件是从别的项目拷过来的,没有修改,改为com.shu.dao后 @Autowired注解正常了,问题解决。