现象
IllegalStateException: Duplicate spring bean id orgQueryService解决
应用任务运行异常: exception is java.lang.IllegalStateException: Duplicate spring bean id orgQueryService

排查
orgQueryService的bean是写在spring-dubbo-consumer.xml中的,而且这个bean确实只有一个
IllegalStateException: Duplicate spring bean id orgQueryService解决
再看报错信息可以看到spring-dubbo-consumer.xml被加载了两次,查找spring-dubbo-consumer.xml被引用的位置发现
IllegalStateException: Duplicate spring bean id orgQueryService解决
IllegalStateException: Duplicate spring bean id orgQueryService解决
spring-dubbo-consumer.xml先被引用进了spring-service.xml里,而后spring-dubbo-consumer.xml,spring-service.xml又都被引用到了web.xml中

解决

将spring-service.xml中import的spring-dubbo-consumer.xml注释掉,重新启动即可

相关文章:

  • 2021-07-09
  • 2022-02-09
  • 2021-11-11
  • 2021-10-31
  • 2022-12-23
  • 2021-11-03
  • 2023-04-01
  • 2021-06-25
猜你喜欢
  • 2022-01-11
  • 2021-09-22
  • 2022-01-28
  • 2022-12-23
  • 2021-07-23
  • 2022-12-23
  • 2021-06-21
相关资源
相似解决方案