intellij idea里神坑的@autowire


當你寫完項目的時侯serviceimpl層下的@autowire->對應的是dao層的注入,其下面會出現一條紅線

在Intellij Idea開發工具在@Autowired或者@Resource注入XxxMapper接口時報如下錯誤:

Could not autowire. No beans of ‘XxxMapper’ type found. less… (Ctrl+F1)Checks autowiring problems in a bean class.


解決辦法有在 Intellij Idea中設置里:

Settings - Editor - Inspections - Spring - Spring Core - Code - Autowiring for Bean Class - disable(把√去掉)。


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM