Dubbo消费者启动报Failed to check the status of the service

项目中准备使用Dubbo,运行官方的Provider和Consumer没有问题,自己写了个简单的SayHello进行测试,生产者启动后,通过DubboAdmin可以看到(不存在有人说的服务启动后又消失的问题),但启动生产者却报发下错误

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 cn.feezu.carsearch.service.DemoService. No provider available for the service cn.feezu.carsearch.service.DemoService from the url zookeeper://127.0.0.1:2181/com.alibaba.dubbo.registry.RegistryService?application=consumer-of-helloworld-app&default.timeout=5000&dubbo=2.5.3&interface=cn.feezu.carsearch.service.DemoService&methods=sayHello&pid=8148&side=consumer×tamp=1440572169099 to the consumer 10.10.8.101 use dubbo version 2.5.3
	at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.doGetObjectFromFactoryBean(FactoryBeanRegistrySupport.java:151)
	at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.getObjectFromFactoryBean(FactoryBeanRegistrySupport.java:103)
	at org.springframework.beans.factory.support.AbstractBeanFactory.getObjectForBeanInstance(AbstractBeanFactory.java:1514)
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:252)
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:195)
	at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:973)
	at Main.main(Main.java:15)
Caused by: java.lang.IllegalStateException: Failed to check the status of the service cn.feezu.carsearch.service.DemoService. No provider available for the service cn.feezu.carsearch.service.DemoService from the url zookeeper://127.0.0.1:2181/com.alibaba.dubbo.registry.RegistryService?application=consumer-of-helloworld-app&default.timeout=5000&dubbo=2.5.3&interface=cn.feezu.carsearch.service.DemoService&methods=sayHello&pid=8148&side=consumer×tamp=1440572169099 to the consumer 10.10.8.101 use dubbo version 2.5.3
	at com.alibaba.dubbo.config.ReferenceConfig.createProxy(ReferenceConfig.java:420)
	at com.alibaba.dubbo.config.ReferenceConfig.init(ReferenceConfig.java:300)
	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.doGetObjectFromFactoryBean(FactoryBeanRegistrySupport.java:144)
	... 6 more

生产者的XML配置如下:



    
 
    
        
     
    
    
    

    
         
    
    

 消费者的XML配置如下:



  
    
    
  
  	
        
  
    
  
    
    
  

 

经过反复查找原因终于锁定了生产者XML文件中的version="1.0"

教训:如果生产者设定了服务的版本,消费者一定要提供相应的版本号(或空或写入对应的版本号)

 

如果有朋友不是这个问题,建议看看防火墙,有也在Dubbo的社区也问题过类似问题,梁飞的回复可能是防火墙的问题,建议关掉试下。

 

你可能感兴趣的:(Dubbo)