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"/>
  • 相关阅读:
    js动态添加、删除行
    java内存问题排查及分析
    IDE 热部署配置
    Target JRE version (1.7.0_79) does not match project JDK version (java version "1.8.0_171"), will use sources from JDK: 1.7
    快速排序
    归并排序思想
    算法总结
    百度2013校园招聘笔试题(含整理的答案)
    浙江省委书记(习):加快推进节约型社会建设
    申论方面的经验
  • 原文地址:https://www.cnblogs.com/liangxinxinbo/p/8204305.html
Copyright © 2011-2022 走看看