按照Demo写的代码运行Cunsummer时 Failed to check the status of the service com.alibaba.dubbo.demo.DemoService
按照例子配置:
provider.xml
consummer.xml

telnet可以看到服务:

但是运行Cunsummer时,getBean报错,: Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'demoService': FactoryBean threw exception on object creation; nested exception is java.lang.IllegalStateException: Failed to check the status of the service com.alibaba.dubbo.demo.DemoService. No provider available for the service com.alibaba.dubbo.demo.DemoService from the url multicast://225.0.0.0:1234/com.alibaba.dubbo.registry.RegistryService?anyhost=true&application=consumer-of-helloworld-app&check=false&connected=true&dubbo=2.4.9&interface=com.alibaba.dubbo.demo.DemoService&methods=sayHello&pid=12256&revision=service&side=consumer×tamp=1402064250263 to the consumer 192.168.1.6 use dubbo version 2.4.9 at org.springframework.beans.factory.support.FactoryBeanRegistrySupport$1.run(FactoryBeanRegistrySupport.java:127) at java.security.AccessController.doPrivileged(Native Method) at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.doGetObjectFromFactoryBean(FactoryBeanRegistrySupport.java:116) at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.getObjectFromFactoryBean(FactoryBeanRegistrySupport.java:91) at org.springframework.beans.factory.support.AbstractBeanFactory.getObjectForBeanInstance(AbstractBeanFactory.java:1285) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:217) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164) at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:881) at Consumer.main(Consumer.java:11) Caused by: java.lang.IllegalStateException: Failed to check the status of the service com.alibaba.dubbo.demo.DemoService. No provider available for the service com.alibaba.dubbo.demo.DemoService from the url multicast://225.0.0.0:1234/com.alibaba.dubbo.registry.RegistryService?anyhost=true&application=consumer-of-helloworld-app&check=false&connected=true&dubbo=2.4.9&interface=com.alibaba.dubbo.demo.DemoService&methods=sayHello&pid=12256&revision=service&side=consumer×tamp=1402064250263 to the consumer 192.168.1.6 use dubbo version 2.4.9 at com.alibaba.dubbo.config.ReferenceConfig.createProxy(ReferenceConfig.java:422) at com.alibaba.dubbo.config.ReferenceConfig.init(ReferenceConfig.java:303) at com.alibaba.dubbo.config.ReferenceConfig.get(ReferenceConfig.java:138) at com.alibaba.dubbo.config.spring.ReferenceBean.getObject(ReferenceBean.java:65) at org.springframework.beans.factory.support.FactoryBeanRegistrySupport$1.run(FactoryBeanRegistrySupport.java:121) ... 9 more
换成registry-simple就可以了,multicast不行。还不知道为什么
应该是多网卡多IP引起的问题,可以参考https://www.jianshu.com/p/3646263199a1文章底部的问题分析
应该是多网卡多IP引起的问题,可以参考https://www.jianshu.com/p/3646263199a1文章底部的问题分析 赞👍,这里也提到了这个的解决方法: https://github.com/apache/dubbo/issues/3561#issuecomment-498574806