首页 > 其他分享 >【整理】@Autowired飘红

【整理】@Autowired飘红

时间:2023-01-23 11:44:43浏览次数:34  
标签:Core Autowired 飘红 -- bean 整理 对应

现象:

 

通过@Autowired在service层注入Mapper接口,在编辑情况下,无法找不到对应的bean,于是提示找不到对应bean的错误,但实际上,项目是可以正常运行的。

可在File -- Settings -- Inspections,在Spring Core -- Core -- Autowring for Bean Class 中,将Severity的级别由之前的error改成warning。

 

或者把@Autowired改为@Resource,就不飘红了。

 

标签:Core,Autowired,飘红,--,bean,整理,对应
From: https://www.cnblogs.com/uncleyong/p/16201890.html

相关文章