apache/dubbo

multiple registries problem when using properties configuration with Dubbo 2.7.10(Dubbo 2.7.10使用配置文件配置多注册中心时无法成功)

Open

#8,192 建立於 2021年7月1日

在 GitHub 查看
 (0 留言) (0 反應) (0 負責人)Java (26,453 fork)batch import
help wanted

倉庫指標

Star
 (41,524 star)
PR 合併指標
 (平均合併 7天 14小時) (30 天內合併 20 個 PR)

描述

  • I have searched the issues of this repository and believe that this is not a duplicate.
  • I have checked the FAQ of this repository and believe that this is not a duplicate.

Environment

  • Dubbo version: 2.7.10
  • Operating System version: win 10
  • Java version: JDK8

Hi,today I want to register one service into several registries like two different zookeeper.I checked the document multi-registry,the example like <dubbo:registry id="hangzhouRegistry" address="10.20.141.150:9090" /> <dubbo:registry id="qingdaoRegistry" address="10.20.141.151:9010" default="false" /> separate different registries from different id. since my application uses externalized configuration instead of configured in xml file,I checked the mapping rules between xml and properties, I using following configuration to register into 2 zookeeper: dubbo.registry.zk2.address=zookeeper://172.26.22.77:2181, dubbo.registry.zk1.address=zookeeper://172.26.22.77:2182 but it failed.The error log shows it didn't analysis this configuration.

I want to know it's my confugration problem or else reasons, Pls. provide [GitHub address] to reproduce this issue.

Expected Result

What do you expected from the above steps?

Actual Result

What actually happens? configuration didn't work, my services didn't registry successfully, and my application throw an exception. If there is an exception, please attach the exception trace:

java.lang.IllegalStateException: No registry config found or it's not a valid config! The registry config is: <dubbo:registry />
	at org.apache.dubbo.config.AbstractInterfaceConfig.checkRegistry(AbstractInterfaceConfig.java:201)
	at org.apache.dubbo.config.ServiceConfig.checkAndUpdateSubConfigs(ServiceConfig.java:232)
	at org.apache.dubbo.config.ServiceConfig.export(ServiceConfig.java:190)
	at org.apache.dubbo.config.bootstrap.DubboBootstrap.lambda$exportServices$14(DubboBootstrap.java:1088)
	at java.util.HashMap$Values.forEach(HashMap.java:981)
	at org.apache.dubbo.config.bootstrap.DubboBootstrap.exportServices(DubboBootstrap.java:1075)
	at org.apache.dubbo.config.bootstrap.DubboBootstrap.start(DubboBootstrap.java:889)
	at org.apache.dubbo.config.spring.context.DubboBootstrapApplicationListener.onContextRefreshedEvent(DubboBootstrapApplicationListener.java:69)
	at org.apache.dubbo.config.spring.context.DubboBootstrapApplicationListener.onApplicationContextEvent(DubboBootstrapApplicationListener.java:62)
	at com.alibaba.spring.context.OnceApplicationContextEventListener.onApplicationEvent(OnceApplicationContextEventListener.java:52)
	at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:172)
	at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:165)
	at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:139)
	at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:393)
	at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:347)
	at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:883)
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:545)
	at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:443)
	at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:325)
	at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:107)
	at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4705)
	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5171)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1412)
	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1402)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)

貢獻者指南