问题

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

相关文章:

  • 2021-06-04
  • 2021-07-13
  • 2021-07-29
  • 2021-04-13
  • 2021-10-15
猜你喜欢
  • 2021-07-04
  • 2021-11-22
  • 2021-05-31
  • 2021-06-29
  • 2021-08-11
  • 2021-04-25
  • 2021-08-27
相关资源
相似解决方案