The DbSchedulerAutoConfiguration#eagerDbSchedulerStarter must be declared as static to ensure it is available before the initialization of DbSchedulerAutoConfiguration. Spring Boot will otherwise try to instantiate the DbSchedulerAutoConfiguration class using a no-args constructor.
NOTE: Beans of this type will be instantiated very early in the spring application lifecycle so they should generally be declared static and not have any dependencies.
The
DbSchedulerAutoConfiguration#eagerDbSchedulerStarter
must be declared as static to ensure it is available before theinitialization
ofDbSchedulerAutoConfiguration
. Spring Boot will otherwise try to instantiate theDbSchedulerAutoConfiguration
class using a no-args constructor.https://docs.spring.io/spring-boot/api/java/org/springframework/boot/LazyInitializationExcludeFilter.html#:~:text=NOTE%3A%20Beans%20of%20this%20type%20will%20be%20instantiated%20very%20early%20in%20the%20spring%20application%20lifecycle%20so%20they%20should%20generally%20be%20declared%20static%20and%20not%20have%20any%20dependencies.
Example - auto-configuration class with an args-constructor; https://github.com/spring-projects/spring-boot/blob/ef303e74f7b92373e32d1cf95a121b37d377960a/spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/endpoint/jmx/JmxEndpointAutoConfiguration.java#L116
Fixes #511
Reminders
mvn spotless:apply
cc @kagkarlsson