irpas技术客

【dubbo】No provider available from registry 127.0.0.1:2181 for service com.dubbo.

大大的周 3314

页面访问:http://localhost:8062/add?a=111,报报错如下(消费者服务也是报这种错):

Whitelabel Error Page

This application has no explicit mapping for /error, so you are seeing this as a fallback.

Thu Sep 09 14:02:22 CST 2021

There was an unexpected error (type=Internal Server Error, status=500).

No provider available from registry 127.0.0.1:2181 for service com.dubbo.api.service.CostService on consumer 10.1.31.154 use dubbo version 2.6.2, please check status of providers(disabled, not registered or in blacklist).

错误的意思是在服务消费端的功能中调用服务提供端的逻辑时没有发现服务提供者对象。主要就是服务提供方代码的问题了。

com.alibaba.dubbo.config.annotation.Service:用于标注对外暴露的dubbo接口实现类。 org.springframework.stereotype.Service:用于标注根据业务块分离的Service的实现类,对应的是业务层(如一个dubbo方法可能调用多个业务块的service,这些service的实现类就用Spring的注解)。 参考链接:https://blog.csdn.net/zlbdmm/article/details/113974292

修改后运行正常

?


1.本站遵循行业规范,任何转载的稿件都会明确标注作者和来源;2.本站的原创文章,会注明原创字样,如未注明都非原创,如有侵权请联系删除!;3.作者投稿可能会经我们编辑修改或补充;4.本站不提供任何储存功能只提供收集或者投稿人的网盘链接。

标签: #dubboNo #provider #available #from #registry #1270012181 #for #service