问题: expected single matching bean but found 2: xxx,xxx

原因:在 Spring 容器中配置了两个类型Bean,Spring 容器将无法确定到底要用哪一个 Bean,因此异常发生了。

解决方法: 使用 @Qualifier 注释指定注入 Bean 的名称

 

多数据源报错 expected single matching bean but found 2: xxx,xxx

相关文章:

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