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(把√去掉)。

posted @ 2019-01-08 18:07  走在吃唐僧肉的路上  阅读(4479)  评论(0)    收藏  举报