當你寫完項目的時侯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(把√去掉)。
