启动了dubbo,并且服务已经正常运行,却在dubbo里找不到对应的服务!


错误信息:
com.alibaba.dubbo.rpc.RpcException: No provider available from registry 127.0.0.1:2181 for service com.xxx.xxx.service.xxx on consumer 192.168.xxx.xx use dubbo version 2.6.0, may be providers disabled or not registered ?
 

可能的原因、解决方法

1.@Service 没有指明接口的字节码:@Service(interfaceClass = Xxx.class)。

解决方法:


import com.alibaba.dubbo.config.annotation.Service;

@Service(interfaceClass = Xxx.class)
public class XxxImpl implements Xxx{
}

 2.配置文件application.properties、application.yml没有声明Dubbo 服务需要暴露/引用的服务接口

解决方法:

#声明需要暴露/引用的服务接口
spring.dubbo.scan=com.xxx.email,com.xxx.message

Logo

为开发者提供学习成长、分享交流、生态实践、资源工具等服务,帮助开发者快速成长。

更多推荐