From ad803e1c84f3ddb2404c912de5ff2d39b4e535a6 Mon Sep 17 00:00:00 2001 From: foghost Date: Wed, 13 Dec 2023 16:23:14 +0800 Subject: [PATCH] fix DubboAutoConfiguration and DubboRelaxedBinding2AutoConfiguration init too early, (#13461) can not be processed AOT in spring native image scenario --- .../autoconfigure/DubboRelaxedBinding2AutoConfiguration.java | 2 +- .../dubbo/spring/boot/autoconfigure/DubboAutoConfiguration.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dubbo-spring-boot/dubbo-spring-boot-autoconfigure/src/main/java/org/apache/dubbo/spring/boot/autoconfigure/DubboRelaxedBinding2AutoConfiguration.java b/dubbo-spring-boot/dubbo-spring-boot-autoconfigure/src/main/java/org/apache/dubbo/spring/boot/autoconfigure/DubboRelaxedBinding2AutoConfiguration.java index 8883a94464a..1cc1d70cd5d 100644 --- a/dubbo-spring-boot/dubbo-spring-boot-autoconfigure/src/main/java/org/apache/dubbo/spring/boot/autoconfigure/DubboRelaxedBinding2AutoConfiguration.java +++ b/dubbo-spring-boot/dubbo-spring-boot-autoconfigure/src/main/java/org/apache/dubbo/spring/boot/autoconfigure/DubboRelaxedBinding2AutoConfiguration.java @@ -51,7 +51,7 @@ * @see DubboRelaxedBindingAutoConfiguration * @since 2.7.0 */ -@Configuration +@Configuration(proxyBeanMethods = false) @ConditionalOnProperty(prefix = DUBBO_PREFIX, name = "enabled", matchIfMissing = true) @ConditionalOnClass(name = "org.springframework.boot.context.properties.bind.Binder") @AutoConfigureBefore(DubboRelaxedBindingAutoConfiguration.class) diff --git a/dubbo-spring-boot/dubbo-spring-boot-compatible/autoconfigure/src/main/java/org/apache/dubbo/spring/boot/autoconfigure/DubboAutoConfiguration.java b/dubbo-spring-boot/dubbo-spring-boot-compatible/autoconfigure/src/main/java/org/apache/dubbo/spring/boot/autoconfigure/DubboAutoConfiguration.java index acf60f04dfc..52825ad6dcd 100644 --- a/dubbo-spring-boot/dubbo-spring-boot-compatible/autoconfigure/src/main/java/org/apache/dubbo/spring/boot/autoconfigure/DubboAutoConfiguration.java +++ b/dubbo-spring-boot/dubbo-spring-boot-compatible/autoconfigure/src/main/java/org/apache/dubbo/spring/boot/autoconfigure/DubboAutoConfiguration.java @@ -62,7 +62,7 @@ public class DubboAutoConfiguration { @ConditionalOnProperty(prefix = DUBBO_SCAN_PREFIX, name = BASE_PACKAGES_PROPERTY_NAME) @ConditionalOnBean(name = BASE_PACKAGES_BEAN_NAME) @Bean - public ServiceAnnotationPostProcessor serviceAnnotationBeanProcessor( + public static ServiceAnnotationPostProcessor serviceAnnotationBeanProcessor( @Qualifier(BASE_PACKAGES_BEAN_NAME) Set packagesToScan) { ServiceAnnotationPostProcessor serviceAnnotationPostProcessor; try {