zoukankan      html  css  js  c++  java
  • 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"/>
  • 相关阅读:
    ORACLE权限管理
    ORACLE12.2.0.1.0 支持数据对象名称超过30个字符
    Redhat下卸载自带Mysql相关组键
    周鸿祎:如何做好产品经理
    javascript类型与类型检测
    AJAX
    HTTP协议
    HTML5web存储之localStorage
    CSS定位的三种机制:普通流、绝对定位和浮动
    CSS元素居中的常用方法
  • 原文地址:https://www.cnblogs.com/liangxinxinbo/p/8204305.html
Copyright © 2011-2022 走看看