使用IDEA工具时使用@Resource和@Autowired自动注解bean时会显示红色,但是项目能运行 。

解决方法: 

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

原因:intellij比eclipse对代码的检查更为严格,导致此处不通过,然而并不影响使用。

IDEA使用 @Autowired和@Resource时报错

相关文章:

  • 2022-01-08
  • 2021-06-06
  • 2021-10-15
  • 2021-05-08
  • 2021-05-17
  • 2022-12-23
  • 2021-08-08
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-03-02
  • 2021-09-23
  • 2022-12-23
  • 2021-11-29
相关资源
相似解决方案