今天测试dubbo的多播注册中心时遇到找不到服务提供者的问题,记录下问题及解决办法。
问题描述
按照Dubbo官方文档,Dubbo支持Multicast注册中心,我在本地启动消费者时提示
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'speakController': Injection of @Reference dependencies is failed; nested exception is java.lang.IllegalStateException: Failed to check the status of the service com.yiika.dubbo.dubbointerface.EchoService. No provider available for the service com.yiika.dubbo.dubbointerface.EchoService from the url multicast://224.5.6.7:1234/org.apache.dubbo.registry.RegistryService?application=dubbo-consumer&dubbo=2.0.2&interface=com.yiika.dubbo.dubbointerface.EchoService&lazy=false&methods=echo&pid=75400&qos.enable=false®ister.ip=10.37.129.2&release=2.7.3&side=consumer&sticky=false×tamp=1573636385238 to the consumer 10.37.129.2 use dubbo version 2.7.3
at org.apache.dubbo.config.spring.beans.factory.annotation.AnnotationInjectedBeanPostProcessor.postProcessPropertyValues(AnnotationInjectedBeanPostProcessor.java:151) ~[dubbo-2.7.3.jar:2.7.3]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1383) ~[spring-beans-5.1.3.RELEASE.jar:5.1.3.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:575) ~[spring-beans-5.1.3.RELEASE.jar:5.1.3.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:498) ~[spring-beans-5.1.3.RELEASE.jar:5.1.3.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:320) ~[spring-beans-5.1.3.RELEASE.jar:5.1.3.RELEASE]
at org.springframework.bean