apache / apache/dubbo

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

Open
#8,192 0 comments 0 reactions 0 assignees View on GitHub
help wanted
Dominant language
Java
Stars
41.6k
Forks
26.4k
Avg merge
15h 13m
Merged PRs (30d)
4

Description

- [ ] 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.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](https://dubbo.apache.org/zh/docs/v2.7/user/examples/multi-registry/),the example like
`
`
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:
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)
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.