新导出的项目,总出现Could not autowire. No beans of 'xxxx' type found的错误提示,

Could not autowire. No beans of 'xxxx' type found的错误提示

现在有两个解决办法

1:降低Autowired检测的级别,将Severity的级别由之前的error改成warning或其它可以忽略的级别。

Could not autowire. No beans of 'xxxx' type found的错误提示

如果没有效果,看方法二

2:在接口的class 加入@Component,如第一个截图的 UserInfoMapper,按ctrl点进去,在这个类的声明前面加@Component,

Could not autowire. No beans of 'xxxx' type found的错误提示

第二种的局限性是如果引入的是jar包中的接口,可能无法修改,或者要重新去jar项目里打包。

相关文章:

  • 2021-05-31
  • 2021-12-16
  • 2022-12-23
  • 2021-05-29
  • 2021-08-05
猜你喜欢
  • 2021-08-14
  • 2021-11-22
  • 2021-04-14
  • 2021-10-02
相关资源
相似解决方案