写dubbo服务时遇到 dubbo异常:Failed to check the status of the service . No provider available for the servic

在学习电商项目时,一开始我是在宿舍学写的项目。![这里是我写的provider](https://img-blog.csdnimg.cn/20191101213448146.png)
前三个项目是在宿舍写的,然后第四个是在课室写的,当时插了网线(所以是换了ip地址的问题???)。
然后在启动dubbo服务,运行comsumer时,![在这里插入图片描述](https://img-blog.csdnimg.cn/20191101213707803.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3FxXzQwMzk2NjUx,size_16,color_FFFFFF,t_70)

这时出现错误
com.alibaba.dubbo.config.spring.AnnotationBean 2019-11-01 08:27:28 [DUBBO] Failed to init remote service reference at filed tbItemParamServiceImpl in class com.ego.manage.service.impl.TbItemParamServiceImpl, cause: Failed to check the status of the service com.ego.manage.service.TbItemParamService. No provider available for the service com.ego.manage.service.TbItemParamService from the url zookeeper://192.168.140.133:2181/com.alibaba.dubbo.registry.RegistryService?application=dubbo-manage&dubbo=2.5.3&interface=com.ego.manage.service.TbItemParamService&methods=show&pid=3364&side=consumer&timestamp=1572611247985 to the consumer 192.168.140.1 use dubbo version 2.5.3, dubbo version: 2.5.3, current host: 192.168.140.1

java.lang.IllegalStateException: Failed to check the status of the service com.ego.manage.service.TbItemParamService. No provider available for the service com.ego.manage.service.TbItemParamService from the url zookeeper://192.168.140.133:2181/com.alibaba.dubbo.registry.RegistryService?application=dubbo-manage&dubbo=2.5.3&interface=com.ego.manage.service.TbItemParamService&method

然后我上dubbo的admin页面发现在课室新写的TbItemParamDubboServiceImpl【provider】写着没有消费者,而consumer项目写着没有提供者。

上网看了一些文章,是因为换了ip地址,然后provider向zookeeper发布服务时,ip变了?即服务提供者provider的ip变了,所以消费方consumer拿不到provider的ip

后面我把新写的项目删除后,在宿舍再重写,就ok了

看网上说把vmare的虚拟网卡关了,在网络适配器关了,但我关了后,xshell远程连接不上linux。

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值