DUBBO 报错 Failed to check the status of the service

不知道为什么消费者不能调用,报错如下:

Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'ISerivceApi': FactoryBean threw exception on object creation; nested exception is java.lang.IllegalStateException: Failed to check the status of the service com.cnepay.service.api.ISerivceApi. No provider available for the service com.cnepay.service.api.ISerivceApi from the url zookeeper://192.168.1.50:2181/com.alibaba.dubbo.registry.RegistryService?application=ConsumerMerchantService&dubbo=2.5.4-SNAPSHOT&interface=com.cnepay.service.api.ISerivceApi&methods=listSettles,listMerchants,getAuthorityMenu,login,getAllCurrentAmount,listTrans,getHomePageShow&pid=14132&side=consumer&timestamp=1478084031098 to the consumer 192.168.4.133 use dubbo version 2.5.4-SNAPSHOT

at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.doGetObjectFromFactoryBean(FactoryBeanRegistrySupport.java:175)
at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.getObjectFromFactoryBean(FactoryBeanRegistrySupport.java:103)
at org.springframework.beans.factory.support.AbstractBeanFactory.getObjectForBeanInstance(AbstractBeanFactory.java:1590)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:254)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1054)
at com.cnepay.test.Consumer.main(Consumer.java:21)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:140)
Caused by: java.lang.IllegalStateException: Failed to check the status of the service com.cnepay.service.api.ISerivceApi. No provider available for the service com.cnepay.service.api.ISerivceApi from the url zookeeper://192.168.1.50:2181/com.alibaba.dubbo.registry.RegistryService?application=ConsumerMerchantService&dubbo=2.5.4-SNAPSHOT&interface=com.cnepay.service.api.ISerivceApi&methods=listSettles,listMerchants,getAuthorityMenu,login,getAllCurrentAmount,listTrans,getHomePageShow&pid=14132&side=consumer&timestamp=1478084031098 to the consumer 192.168.4.133 use dubbo version 2.5.4-SNAPSHOT
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:168)

... 11 more

修改方法,在消费者配置文件引用服务的时候加上version 

<dubbo:reference id="ISerivceApi" version="1.0.0" interface="com.cnepay.service.api.ISerivceApi" />

在这个version是在定义service的时候定义的,例如注解:

@Service(version = "1.0.0")
然后就好了

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

成风破浪

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值