You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by GitBox <gi...@apache.org> on 2021/08/12 09:08:21 UTC

[GitHub] [dubbo] opver opened a new issue #8487: dubbo2.7.12 start with springboot export No registry config found or it's not a valid config! The registry config is:

opver opened a new issue #8487:
URL: https://github.com/apache/dubbo/issues/8487


   - [ ] I have searched the [issues](https://github.com/apache/dubbo/issues) of this repository and believe that this is not a duplicate.
   - [ ] I have checked the [FAQ](https://github.com/apache/dubbo/blob/master/FAQ.md) of this repository and believe that this is not a duplicate.
   
   ### Environment
   
   * Dubbo version: 2.7.12
   * Operating System version: mac
   * Java version: 1.8
   
   ### Steps to reproduce this issue
   
   1. add spring-boot-starter-jdbc,spring-boot-devtools to pom
   2. service start
   
   Pls. provide [GitHub address] to reproduce this issue.
   
   ### Expected Result
   
   service start success
   
   ### Actual Result
   
   export ”No registry config found or it's not a valid config! The registry config is: <dubbo:registry />“
   
   ### Reason
   springboot启动时由于存在spring-boot-devtools自动装配会去判断装配条件
       static class DevToolsDataSourceCondition extends SpringBootCondition implements ConfigurationCondition {
           DevToolsDataSourceCondition() {
           }
   
           public ConfigurationPhase getConfigurationPhase() {
               return ConfigurationPhase.REGISTER_BEAN;
           }
   
           public ConditionOutcome getMatchOutcome(ConditionContext context, AnnotatedTypeMetadata metadata) {
               Builder message = ConditionMessage.forCondition("DevTools DataSource Condition", new Object[0]);
               String[] dataSourceBeanNames = context.getBeanFactory().getBeanNamesForType(DataSource.class);
               if (dataSourceBeanNames.length != 1) {
                   return ConditionOutcome.noMatch(message.didNotFind("a single DataSource bean").atAll());
               } else if (context.getBeanFactory().getBeanNamesForType(DataSourceProperties.class).length != 1) {
                   return ConditionOutcome.noMatch(message.didNotFind("a single DataSourceProperties bean").atAll());
               } else {
                   BeanDefinition dataSourceDefinition = context.getRegistry().getBeanDefinition(dataSourceBeanNames[0]);
                   return dataSourceDefinition instanceof AnnotatedBeanDefinition && ((AnnotatedBeanDefinition)dataSourceDefinition).getFactoryMethodMetadata() != null && ((AnnotatedBeanDefinition)dataSourceDefinition).getFactoryMethodMetadata().getDeclaringClassName().startsWith(DataSourceAutoConfiguration.class.getPackage().getName() + ".DataSourceConfiguration$") ? ConditionOutcome.match(message.foundExactly("auto-configured DataSource")) : ConditionOutcome.noMatch(message.didNotFind("an auto-configured DataSource").atAll());
               }
           }
       }
   
   context.getBeanFactory().getBeanNamesForType(DataSource.class)这句代码导致RegistryConfig被初始化,但是DubboConfigEarlyInitializationPostProcessor还没有被加入,导致config.addIntoConfigManager()无法被调用,后续创建dubbo引用时由于ApplicaitonModel.getConfigManager().getRegistry(String id)获取不到RegistryConfig,导致报错


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] AlbumenJ commented on issue #8487: dubbo2.7.12 start with springboot export No registry config found or it's not a valid config! The registry config is:

Posted by GitBox <gi...@apache.org>.
AlbumenJ commented on issue #8487:
URL: https://github.com/apache/dubbo/issues/8487#issuecomment-899057847


   @kylixs PTAL


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org