Could not autowire. No beans of 'UserDao' type found

Idea在@Autowired注入时报错

如图,是因为idea检测能力太强,一旦没有找到实现类就会报错,但是我试了,这里其实是注入进来了的,可以正常使用的,但是强迫症,报红看着很难受。

解决办法如下:

Idea在@Autowired注入时报错

Idea在@Autowired注入时报错

将Error降为Warning

Idea在@Autowired注入时报错

然后点右下角的ok。再看代码:

Idea在@Autowired注入时报错

就不报红色的错误了。

 

相关文章:

  • 2021-06-24
  • 2022-01-30
  • 2022-12-23
  • 2021-04-23
  • 2022-12-23
  • 2022-01-05
  • 2021-12-16
猜你喜欢
  • 2022-01-08
  • 2021-05-17
  • 2022-12-23
  • 2022-01-13
  • 2021-11-29
  • 2021-05-24
  • 2022-12-23
相关资源
相似解决方案