https://developer.aliyun.com/article/841316
简介: 解决IDEA中 Could not autowire. No beans of ‘xxxx’ type found 的错误提示
近段时间,转到IDEA来开发公司项目。但是经常会出现Could not autowire. No beans of ‘xxxx’ type found的错误提示。
这个错误提示并不会产生影响,程序的编译和运行都是没有问题的。
但是对于强迫症而言,红色的错误提示是不可容忍的。所以开始着手解决
1)不管他
表示强迫症真的是受不了
2) 修改注解
@Autowired(required = false)
3) 使用@Resource注解
@Resource
4) 修改IDEA配置
修改IDEA设置,降低Autowired检测的级别,将Severity的级别由之前的error改成warning或其它可以忽略的级别。