You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When configure dubbo service or reference bean by xml, the placeholder will not be replaced by user defined properties. if registry config not configured by dubbo.registries.<registry id> or has no default service registry config, it will throw an exception:
Causedby: java.lang.IllegalStateException: Noregistryconfigfoundorit's not a valid config! The registry config is: <dubbo:registry valid="false" id="registry2" prefix="dubbo.registries." />
atorg.apache.dubbo.config.AbstractInterfaceConfig.checkRegistry(AbstractInterfaceConfig.java:177)
atorg.apache.dubbo.config.ReferenceConfig.createProxy(ReferenceConfig.java:306)
atorg.apache.dubbo.config.ReferenceConfig.init(ReferenceConfig.java:266)
atorg.apache.dubbo.config.ReferenceConfig.get(ReferenceConfig.java:151)
atorg.apache.dubbo.config.spring.ReferenceBean.getObject(ReferenceBean.java:68)
atorg.springframework.beans.factory.support.FactoryBeanRegistrySupport.doGetObjectFromFactoryBean(FactoryBeanRegistrySupport.java:171)
... 88more
If we have default registry config (dubbo.registry.xxx), the reference bean defined in xml will using the default registry config even though we have configured registry in xml. if there is no default resgistry config, but configured by dubbo.registries.<registry id>,reference bean will using registry config defined by dubbo.registries if registry id was the same.
In both cases, the registry config defined in xml are not going to work and ignored by dubbo.
Following configuration can reproduce these exception described above.
Dubbo: 2.7.5
Dubbo Spring Boot : 2.7.5
Spring Boot : 2.2.2.RELEASE
case 1
This config will cause No registry config found or it's not a valid config.
application.properties
dubbo.application.id=demo
dubbo.application.name=demo
# true or false has no effect#dubbo.config.multiple=truedubbo.registries.registry1.id=registry1
dubbo.registries.registry1.address=zookeeper://localhost:2181
dubbo.registries.registry1.file=/Users/test/dubbo/registry/registry1
# this config is not workingdubbo.demo.registry=zookeeper://localhost:2181
dubbo.registry.file.path=/Users/test/dubbo/registry/registry2
This config will cause reference bean using default registry config even if we define it in XML. application.properties
dubbo.application.id=demo
dubbo.application.name=demo
# default resgistry# reference bean will use default registry config even if registry id are different.dubbo.registry.id=registry1
dubbo.registry.address=zookeeper://localhost:2181
dubbo.registry.file=/Users/test/dubbo/registry/default
# this configuration is not going to workdubbo.demo.registry=zookeeper://localhost:2181
dubbo.registry.file.path=/Users/test/dubbo/registry/registry2
This config will cause reference bean using registry defined by dubbo.resgisties.xxx
application.properties
dubbo.application.id=demo
dubbo.application.name=demo
dubbo.config.multiple=true
# registry 1 configdubbo.registries.registry1.id=registry1
dubbo.registries.registry1.address=zookeeper://localhost:2181
dubbo.registries.registry1.file=/Users/test/dubbo/registry/registry1
# registry 2 config# reference bean defined in xml will use this registry as registry id are the samedubbo.registries.registry2.id=registry2
dubbo.registries.registry2.address=zookeeper://localhost:2181
dubbo.registries.registry2.file=/Users/test/dubbo/registry/registry2
# this config is still not going to workdubbo.demo.registry=zookeeper://localhost:2181
dubbo.registry.file.path=/Users/test/dubbo/registry/registry2_xml
The text was updated successfully, but these errors were encountered:
mooseen
changed the title
No registry config found or it's not a valid config! The registry config is: <dubbo:registry valid="false" id="registry2" prefix="dubbo.registries." />
No registry config found or it's not a valid config if registry configured by xml with placeholder
Jan 2, 2020
When configure dubbo service or reference bean by xml, the placeholder will not be replaced by user defined properties. if registry config not configured by
dubbo.registries.<registry id>
or has no default service registry config, it will throw an exception:If we have default registry config (
dubbo.registry.xxx
), the reference bean defined in xml will using the default registry config even though we have configured registry in xml. if there is no default resgistry config, but configured bydubbo.registries.<registry id>
,reference bean will using registry config defined bydubbo.registries
if registry id was the same.In both cases, the registry config defined in xml are not going to work and ignored by dubbo.
Following configuration can reproduce these exception described above.
case 1
This config will cause
No registry config found or it's not a valid config
.application.properties
biz-consumer.xml
case 2
This config will cause reference bean using default registry config even if we define it in XML.
application.properties
biz-consumer.xml
case 3
This config will cause reference bean using registry defined by
dubbo.resgisties.xxx
application.properties
biz-consumer.xml
The text was updated successfully, but these errors were encountered: