SSM框架Could not autowire. No beans of UserDao type found

问题

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注解正常了,问题解决。