【问题标题】:Using chaos-monkey-spring-boot together with db-scheduler: getting BeanDefinitionOverrideException将 chaos-monkey-spring-boot 与 db-scheduler 一起使用:获取 BeanDefinitionOverrideException
【发布时间】:2022-05-10 04:13:17
【问题描述】:

使用最新版本的 chaos-monkey-spring-boot (v2.5.4) 和 db-scheduler-spring-boot-starter (v10.3, 请参阅https://github.com/kagkarlsson/db-scheduler),启动应用程序时出现异常:

The bean 'scheduler', defined in class path resource [de/codecentric/spring/boot/chaos/monkey/configuration/ChaosMonkeyConfiguration.class], could not be registered. A bean with that name has already been defined in class path resource [com/github/kagkarlsson/scheduler/boot/autoconfigure/DbSchedulerAutoConfiguration.class] and overriding is disabled.

不幸的是,这两个库都使用了一个过于通用的名称“调度程序”的 bean。覆盖 Bean 定义不是一种选择,它会导致其他问题。

您有什么想法可以解决这个问题吗?

【问题讨论】:

    标签: spring-boot-chaos-monkey


    【解决方案1】:

    Chaos Monkey Spring Boot 维护者在这里。正如您正确分析的那样,两个库都公开了相同的 bean。

    它已经出现在 our issue tracker 中并已修复,并将与即将发布的 Chaos Monkey 2.6.0 版本一起发布。

    编辑:已发布https://github.com/codecentric/chaos-monkey-spring-boot/releases/tag/v2.6.1

    【讨论】:

      猜你喜欢
      • 2020-10-29
      • 1970-01-01
      • 2020-04-24
      • 2021-01-03
      • 2021-01-02
      • 2020-03-09
      • 1970-01-01
      • 2016-01-29
      • 2015-11-03
      相关资源
      最近更新 更多