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