• dubbo Failed to check the status of the service com.user.service.UserService. No provider available for the service


    Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userService': FactoryBean threw exception on object creation; nested exception is java.lang.IllegalStateException: Failed to check the status of the service com.user.service.UserService. No provider available for the service com.user.service.UserService from the url zookeeper://localhost:2181/com.alibaba.dubbo.registry.RegistryService?application=userservice&dubbo=2.5.3&interface=com.user.service.UserService&methods=add&pid=39796&protocol=dubbo&side=consumer&timeout=15000&timestamp=1515132772468 to the consumer 10.100.130.245 use dubbo version 2.5.3

    服务提供方:
    <?xml version="1.0" encoding="UTF-8"?>
    <beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:dubbo="http://code.alibabatech.com/schema/dubbo"
    xsi:schemaLocation="http://www.springframework.org/schema/beans
    http://www.springframework.org/schema/beans/spring-beans.xsd
    http://code.alibabatech.com/schema/dubbo
    http://code.alibabatech.com/schema/dubbo/dubbo.xsd">
    <!--服务提供方服务信息-->
    <dubbo:application name="userclient"/>

    <!--注册中心服务地址-->
    <dubbo:registry id="zookeeper" protocol="zookeeper" address="${dubbo.registry.address}"/>

    <!--用dubbo协议在30001-->
    <dubbo:protocol name="dubbo" port="20880" dispather="all" threadpool="cached" threads="5000"/>
    <!--声明需要暴露的服务接口-->
    <dubbo:service interface="com.user.service.UserService" ref="userService" version="1.0"
    registry="zookeeper" owner="shp"/>
    <!--具体服务接口实现-->
    <bean id="userService" class="com.user.service.impl.userServiceImpl"/>
    </beans>


    消费者
    <?xml version="1.0" encoding="UTF-8"?>
    <beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:dubbo="http://code.alibabatech.com/schema/dubbo"
    xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
    http://code.alibabatech.com/schema/dubbo http://code.alibabatech.com/schema/dubbo/dubbo.xsd">

    <dubbo:application name="userservice"/>

    <dubbo:registry id="zookeeper" protocol="zookeeper" address="${dubbo.registry.address}"/>
    <dubbo:reference id="userService" interface="com.user.service.UserService" protocol="dubbo" timeout="15000"/>

    </beans>

    解决方案: 在 消费者配置文件 dubbo:reference 标签添加 version="1.0",解决。

    <dubbo:reference version="1.0" id="userService" interface="com.user.service.UserService" protocol="dubbo" timeout="15000"/>
  • 相关阅读:
    Instant Python 中文缩减版
    《Java疯狂讲义》(第3版)学习笔记 2
    《Java疯狂讲义》(第3版)学习笔记 1
    NXP Mifare S50标准IC卡- 访问位(Access Bits) 分析
    Python中获取异常(Exception)信息
    支持向量机(SVM)入门
    棋类游戏中人机博弈的设计
    (翻译)如何对python dict 类型按键(keys)或值(values)排序
    Python实现打印二叉树某一层的所有节点
    FIFA halts 2026 bids amid scandal 国际足联在丑闻期间停止2026年足球世界杯申请
  • 原文地址:https://www.cnblogs.com/liangxinxinbo/p/8204305.html
Copyright © 2020-2023  润新知