异常处理com.alibaba.dubbo.rpc.RpcException: No provider available from registry 127.0.0.1:2181 for
2020-06-23 04:47
1776 查看
无法找到对应注册的Dubbo服务问题解决
启动了dubbo,并且服务已经正常运行,却在dubbo里找不到对应的服务!
com.alibaba.dubbo.rpc.RpcException: No provider available from registry 127.0.0.1:2181 for service com.xxx.xxx.user.facade.service.xxx on consumer 192.168.xxx.xx use dubbo version 2.6.0, may be providers disabled or not registered ?
今天进行dubbo调用的时候遇到上面的服务找不到问题。定位到这个报错的注册类,发现问题出在注解上面。
@Service public class XxxImpl implements Xxx{ ...
出现该问题的先决条件
1.@Service 没有指明接口的字节码:@Service(interfaceClass = Xxx.class)。 2.在1的情况下该实现类里的一些方法添加了@Transactional注解。
图片:
满足这两个条件后,该接口本来该注册到dubbo上的,却注册成了org.springframework.aop.SpringProxy代理类。所以调用服务时候就会提示may be providers disabled or not registered ?找不到的原因在这里。
解决方法
1.第一种去掉@Transactional注解。这样操作并不好,因为这个注解我们经常会用到,并且有着重要的作用。 2.第二种@Service 指明接口类的字节码:@Service(interfaceClass = Xxx.class)。这才是规范的接口声明方式。并且不会和@Transactional注解冲突而导致注册org.springframework.aop.SpringProxy代理类。
@Service(interfaceClass = Xxx.class) public class XxxImpl implements Xxx{ ...
总结 使用规范的接口定义,指定清楚接口类的字节码,这才是最好的方式!
相关文章推荐
- No provider available from registry 127.0.0.1:2181 for service com.focussend.email.service.EdmTaskS
- Forbid consumer 127.0.0.1 access service com.alibaba.dubbo.rpc.service.GenericService from registry
- dubbo异常:Failed to check the status of the service . No provider available for the service 解决
- com.alibaba.dubbo.rpc.RpcException: Failed to invoke the method 错误处理
- Dubbo学习笔记:No provider available for the service ...异常问题的解决
- com.alibaba.dubbo.rpc.RpcException: Failed to invoke the method findUserByUserNo in the service wusc.edu.facade.user.service.PmsUserFacade.
- dubbo 提示No such extension Filter for filter/com.alibaba.dubbo.rpc.Filter
- com.alibaba.dubbo.rpc.RpcException: Failed to invoke the method 错误处理
- dubbo 提示No such extension Filter for filter/com.alibaba.dubbo.rpc.Filter
- DUBBO的com.alibaba.dubbo.rpc.RpcException远程调用异常解决方法
- duboox报错:Request processing failed; nested exception is com.alibaba.dubbo.rpc.RpcException
- nested exception is com.alibaba.dubbo.rpc.RpcException: Failed to invoke the method findPage in the
- com.alibaba.dubbo.rpc.RpcException: Since you are
- Dubbo:No provider available for the service
- 有时候出现No provider available for the service dubbo错误
- dubbo实战---No provider available for the service
- dubbo+zookeeper与提供者、消费者之间端口通信问题(No provider available for the service)
- Dubbo错误:No provider available for the service
- com.alibaba.dubbo.rpc.RpcException: Fail to start server(url: dubbo://192.16。。
- RROR com.alibaba.dubbo.rpc.filter.ExceptionFilter.invoke(ExceptionFilter.java:87): [DUBBO] Got unch