dubbo Failed to check the status of the service com.user.service.UserService. No provider available for the service
2024-08-31 11:06:41
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×tamp=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"/>
最新文章
- WCF传输图片解决方案
- Java中常用的查找算法——顺序查找和二分查找
- SQLServer安装错误之--->;无法打开项 UNKNOWN\Components\DA42BC89BF25F5BD0AF18C3B9B1A1EE8\c1c4f01781cc94c4c8fb1542c0981a2a
- oracle物化视图
- hdu 4582 树状DP
- objective-C 中两种实现动画的方法(转)
- mysql查询结果中文显示成了问号
- 在COM接口中不要使用同时出现只是大小写不同的名字作为属性名、函数名或者参数名
- jekyll bootstrap更改主题theme
- CSU1306:Manor(优先队列)
- C++标准库string
- spark运算结果写入hbase及优化
- QM3_Statistics Concepts and Market Returns
- GCC编译器原理(三)------编译原理三:编译过程---预处理
- SQLite 知识摘要 --- 事务
- 再谈数据库优化(database tuning)的真谛和误区
- Hsqldb中设置主键,并让主键自增
- CSSOM
- Backbone前端开发流程及规范
- Vue中把从后端取出的时间进行截取