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