Spring mvc 报错:No qualifying bean of type [java.lang.String] found for dependency:


具体错误:

No qualifying bean of type [java.lang.String] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {}

原因:

1.对应要注入的实现类没有 加注解,如dao层 @Repository  如service层  @Service

2."You generally autowire to your interface type and not impl."调用的接口是否有具体的实现类。

3.@Autowired下面,没有类,直接跟了@RequestMapping。【我报错的原因。无语....】

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM