diff --git a/dubbo-config/dubbo-config-api/src/main/java/org/apache/dubbo/config/ReferenceConfig.java b/dubbo-config/dubbo-config-api/src/main/java/org/apache/dubbo/config/ReferenceConfig.java index da9059771cc..3d24dad2679 100644 --- a/dubbo-config/dubbo-config-api/src/main/java/org/apache/dubbo/config/ReferenceConfig.java +++ b/dubbo-config/dubbo-config-api/src/main/java/org/apache/dubbo/config/ReferenceConfig.java @@ -232,9 +232,10 @@ public synchronized void init() { return; } + if (bootstrap == null) { bootstrap = DubboBootstrap.getInstance(); - bootstrap.init(); + bootstrap.initialize(); } checkAndUpdateSubConfigs(); diff --git a/dubbo-config/dubbo-config-spring/src/main/java/org/apache/dubbo/config/spring/ReferenceBean.java b/dubbo-config/dubbo-config-spring/src/main/java/org/apache/dubbo/config/spring/ReferenceBean.java index be9cd718ce3..dab2135c89c 100644 --- a/dubbo-config/dubbo-config-spring/src/main/java/org/apache/dubbo/config/spring/ReferenceBean.java +++ b/dubbo-config/dubbo-config-spring/src/main/java/org/apache/dubbo/config/spring/ReferenceBean.java @@ -79,6 +79,17 @@ public boolean isSingleton() { return true; } + /** + * Overrides {@link ReferenceConfig#checkAndUpdateSubConfigs()} + * + * @since 2.7.9 + */ + @Override + public void checkAndUpdateSubConfigs() { + prepareDubboConfigBeans(); + super.checkAndUpdateSubConfigs(); + } + /** * Initializes there Dubbo's Config Beans before @Reference bean autowiring */ @@ -100,9 +111,6 @@ private void prepareDubboConfigBeans() { @SuppressWarnings({"unchecked"}) public void afterPropertiesSet() throws Exception { - // Initializes Dubbo's Config Beans before @Reference bean autowiring - prepareDubboConfigBeans(); - // lazy init by default. if (init == null) { init = false;