在用@Autowire注解的时候如果会显红,首先检查代码。一般是没有注入依赖,比如我的显红是因为没有给ProductServiceImpl添加@Service

但是如果代码可以正常运行

idea遇到Could not autowire. No beans of 'ProductServiceImpl' type found. less... (Ctrl+F1) Inspection

解决方法:

点击File--Settings

idea遇到Could not autowire. No beans of 'ProductServiceImpl' type found. less... (Ctrl+F1) Inspection

最后显红没有了

idea遇到Could not autowire. No beans of 'ProductServiceImpl' type found. less... (Ctrl+F1) Inspection

相关文章:

  • 2021-06-21
  • 2021-04-20
  • 2021-06-14
  • 2021-07-29
  • 2021-12-10
  • 2022-01-10
  • 2021-08-13
  • 2021-11-22
猜你喜欢
  • 2021-11-03
  • 2021-12-14
  • 2021-07-01
  • 2022-12-23
  • 2021-10-11
  • 2021-07-12
  • 2021-06-10
相关资源
相似解决方案