'Using chaos-monkey-spring-boot together with db-scheduler: getting BeanDefinitionOverrideException

Using the latest version of chaos-monkey-spring-boot (v2.5.4) together with db-scheduler-spring-boot-starter (v10.3, see https://github.com/kagkarlsson/db-scheduler), I get an exception when starting the application:

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.

Unfortunately, both libraries use a bean with the too generic name 'scheduler'. Bean definition overriding is not an option, it causes other problems.

Do you have any ideas how I can overcome this problem?



Solution 1:[1]

Chaos Monkey Spring Boot Maintainer here. As you analyzed correctly both libraries expose the same beans.

It came already up in our issue tracker and has been fixed and will be released with the soon to be upcoming chaos monkey 2.6.0 release.

EDIT: Its released https://github.com/codecentric/chaos-monkey-spring-boot/releases/tag/v2.6.1

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1