其他分享
首页 > 其他分享> > IntelliJ IDEA报Could not autowire. No beans of 'xxxx' type found错误提示的解决方法

IntelliJ IDEA报Could not autowire. No beans of 'xxxx' type found错误提示的解决方法

作者:互联网

1.问题描述

  在Idea的spring工程里,经常会遇到Could not autowire. No beans of 'xxxx' type found的错误提示。但程序的编译和运行都是没有问题的,这个错误提示并不会产生影响。但红色的错误提示在有些有强迫症的程序员眼里,多多少少有些不太舒服。

 

 

2. 原因

        原因可能有两个,第一个是IntellijIDEA本身工具的问题。第二个便是我们导入@Service包的时候导入包错误造成的

3. 解决方案

  针对第一种原因,解决办法是:降低Autowired检测的级别,将Severity的级别由之前的error改成warning或其它可以忽略的级别。

 

 再看已解决:

 

 参考文章:https://www.cnblogs.com/expiator/p/8991545.html

标签:xxxx,IntelliJ,错误,No,提示,Could,autowire
来源: https://www.cnblogs.com/li-cw/p/15232474.html