diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/BackgroundPreinitializer.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/BackgroundPreinitializer.java index 4970937e88..fd134cc539 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/BackgroundPreinitializer.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/BackgroundPreinitializer.java @@ -30,7 +30,7 @@ import org.springframework.boot.context.event.SpringApplicationEvent; import org.springframework.boot.context.logging.LoggingApplicationListener; import org.springframework.context.ApplicationListener; import org.springframework.core.NativeDetector; -import org.springframework.core.annotation.Order; +import org.springframework.core.Ordered; import org.springframework.format.support.DefaultFormattingConversionService; import org.springframework.http.converter.json.Jackson2ObjectMapperBuilder; import org.springframework.http.converter.support.AllEncompassingFormHttpMessageConverter; @@ -49,8 +49,7 @@ import org.springframework.http.converter.support.AllEncompassingFormHttpMessage * @author Sebastien Deleuze * @since 1.3.0 */ -@Order(LoggingApplicationListener.DEFAULT_ORDER + 1) -public class BackgroundPreinitializer implements ApplicationListener { +public class BackgroundPreinitializer implements ApplicationListener, Ordered { /** * System property that instructs Spring Boot how to run pre initialization. When the @@ -72,6 +71,11 @@ public class BackgroundPreinitializer implements ApplicationListener 1; } + @Override + public int getOrder() { + return LoggingApplicationListener.DEFAULT_ORDER + 1; + } + @Override public void onApplicationEvent(SpringApplicationEvent event) { if (!ENABLED) {