在我开始使用spring boot进行构建网站时,突然弹出一个Could not autowire的红线提示,但是当我进行运行时发现没有任何问题,但是真的看的不舒服,因此我们就要想办法解决。
Could not autowire. No beans of 'xxxx' type found

原因

  • 我们忘记添加注解,程序scan不到我们的对应的类,因此会报错
    Could not autowire. No beans of 'xxxx' type found
  • Intellij IDEA自身级别检测导致的问题

解决方法

原因一

加上注解即可

原因二

方法一

我们打开File --> setting --> Editor --> Code Style --> Insections,把Autowiring for bean Class取消勾选。

方法二

按图操作
Could not autowire. No beans of 'xxxx' type found
Could not autowire. No beans of 'xxxx' type found
取消勾选即可。

相关文章:

  • 2021-05-31
  • 2021-06-29
  • 2021-08-11
  • 2021-04-25
  • 2021-08-27
  • 2021-07-13
  • 2021-07-29
  • 2021-04-13
猜你喜欢
  • 2021-11-22
  • 2021-09-16
  • 2021-11-03
  • 2022-01-10
相关资源
相似解决方案