【dubbo】No provider available from registry 127.0.0.1:2181 for service com.dubbo.api.service
頁面訪問: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
修改后運行正常
?
總結
以上是生活随笔為你收集整理的【dubbo】No provider available from registry 127.0.0.1:2181 for service com.dubbo.api.service的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: ThinkSNS团队衍生产品你知道几个?
- 下一篇: 人工智能-用matlab实现数字识别