Failed to check the status of the service com.test.project.DemoService. No provider available for th

此文章特此记录写代码时犯的最低级的错误

问题描述:

今天使用dubbo时报错,总是显示消费者无法找到服务提供者的报错情况

 这条日志信息表明 Dubbo 消费者在尝试引用服务 com.yupi.project.DemoService 时遇到了问题,具体表现为找不到任何可用的服务提供者

  • Dubbo Module[1.1.1] refer catch error:表示 Dubbo 模块在尝试引用服务时捕获到了错误。
  • Dubbo Module[1.1.1] start failed:表示 Dubbo 模块启动失败,具体原因是没有找到可用的服务提供者。
  • 具体错误信息

    • java.lang.IllegalStateException: Failed to check the status of the service com.yupi.project.DemoService:表示在检查服务状态时出现了非法状态异常。
    • No provider available for the service com.yupi.project.DemoService:表示没有找到任何可用的服务提供者。
2024-09-05 18:06:46.102 ERROR 35568 --- [  restartedMain] o.a.d.c.deploy.DefaultModuleDeployer     :  [DUBBO] Dubbo Module[1.1.1] refer catch error., dubbo version: 3.0.9, current host: 10.24.5.125
2024-09-05 18:06:46.102 ERROR 35568 --- [  restartedMain] o.a.d.c.deploy.DefaultModuleDeployer     :  [DUBBO] Dubbo Module[1.1.1] start failed: java.lang.IllegalStateException: Failed to check the status of the service com.yupi.project.DemoService. No provider available for the service com.yupi.project.DemoService from the url consumer://10.24.5.125/com.yupi.project.DemoService?application=dubbo-springboot-demo-provider&background=false&dubbo=2.0.2&interface=com.yupi.project.DemoService&methods=sayHello,sayHelloAsync,sayHello2&pid=35568&register.ip=10.24.5.125&release=3.0.9&side=consumer&sticky=false&timestamp=1725530805868 to the consumer 10.24.5.125 use dubbo version 3.0.9, dubbo version: 3.0.9, current host: 10.24.5.125
  1. 日志内容

    • Ignore empty notify urls:表示 Dubbo 消费者收到了空的订阅结果,即没有找到任何提供者。
    • for subscribe url:提供了订阅 URL 的详细信息,其中包含了服务名、应用名、接口名以及其他一些 Dubbo 配置参数。
2024-09-05 18:06:45.879  WARN 35568 --- [  restartedMain] o.a.dubbo.registry.nacos.NacosRegistry   :  [DUBBO] Ignore empty notify urls for subscribe url consumer://10.24.5.125/com.yupi.project.DemoService?application=dubbo-springboot-demo-provider&background=false&category=providers,configurators,routers&dubbo=2.0.2&interface=com.yupi.project.DemoService&methods=sayHello,sayHelloAsync,sayHello2&pid=35568&release=3.0.9&side=consumer&sticky=false&timestamp=1725530805868, dubbo version: 3.0.9, current host: 10.24.5.125

 配置检查:

1. 服务提供者:

这是我 服务提供者的配置

dubbo:
  application:
    name: dubbo-springboot-demo-provider
  protocol:
    name: dubbo
    port: -1
  registry:
    id: nacos-registry
    address: nacos://localhost:8848

启动服务和nacos后,访问 http://localhost:8848/nacos  ,能看到服务以及注册上来了

 2. 服务消费者:

当然启动类也加了@EnbaleDubbo注解

解决:

其实问题很简单,只是我当天智商不在线了,因此记录一下丢脸时刻.....

就因为少建了一个“”,所以报了错,服务提供者服务消费者路径必须一样

 

 添加后就能运行了

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

打赏作者

Nobody.sir

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

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

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

打赏作者

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

抵扣说明:

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

余额充值