Giter VIP home page Giter VIP logo

Comments (8)

leizhiyuan avatar leizhiyuan commented on July 28, 2024

@NeGnail

from sofa-rpc-boot-projects.

wangxiaotao00 avatar wangxiaotao00 commented on July 28, 2024

按照demo中配置rest协议, 启动后报错
RPC-02306: 没有获得服务[com.jsmfbank.sse.facade.RestService:1.0]的调用地址,请检查服务是否已经推送

from sofa-rpc-boot-projects.

wangxiaotao00 avatar wangxiaotao00 commented on July 28, 2024

本地访问rest接口正常:http://localhost:8341/webapi/restService/1001

from sofa-rpc-boot-projects.

leizhiyuan avatar leizhiyuan commented on July 28, 2024

@wangxiaotao00 本地 zk 起了吗? 报错日志也提供下.

入门文档中有提到这个.

您可以直接在工程下找到本文档的示例代码。注意,示例代码中需要本地安装 zookeeper 环境,如果没有安装.需要将application.properties中的com.alipay.sofa.rpc.registry.address 配置注释掉.走本地文件注册中心的方式

from sofa-rpc-boot-projects.

wangxiaotao00 avatar wangxiaotao00 commented on July 28, 2024

没有zk,配置文件中注释了。
完整错误日志如下:

2018-05-05 11:50:43.892 INFO 7024 --- [ main] c.j.s.s.SpringBootSseApplication : Started SpringBootSseApplication in 57.374 seconds (JVM running for 57.696)
Exception in thread "main" com.alipay.sofa.rpc.core.exception.SofaRouteException: RPC-02306: 没有获得服务[com.jsmfbank.sse.facade.RestService:1.0]的调用地址,请检查服务是否已经推送
at com.alipay.sofa.rpc.client.AbstractCluster.noAvailableProviderException(AbstractCluster.java:419)
at com.alipay.sofa.rpc.client.AbstractCluster.select(AbstractCluster.java:391)
at com.alipay.sofa.rpc.client.FailoverCluster.doInvoke(FailoverCluster.java:64)
at com.alipay.sofa.rpc.client.AbstractCluster.invoke(AbstractCluster.java:286)
at com.alipay.sofa.rpc.client.ClientProxyInvoker.invoke(ClientProxyInvoker.java:83)
at com.alipay.sofa.rpc.proxy.jdk.JDKInvocationHandler.invoke(JDKInvocationHandler.java:74)
at com.sun.proxy.$Proxy51.sayRest(Unknown Source)
at com.jsmfbank.sse.springbootsse.SpringBootSseApplication.main(SpringBootSseApplication.java:27)

from sofa-rpc-boot-projects.

NeGnail avatar NeGnail commented on July 28, 2024

在调用之前睡一下线程试试。如 sample 中的例子,在调用之前加入 Thread.sleep :

RestService restService = (RestService) applicationContext.getBean("restServiceReference");
Thread.sleep(5000)
String result = restService.sayRest("rest");

from sofa-rpc-boot-projects.

wangxiaotao00 avatar wangxiaotao00 commented on July 28, 2024

可以了,谢谢

from sofa-rpc-boot-projects.

leizhiyuan avatar leizhiyuan commented on July 28, 2024

@wangxiaotao00 好的,稍后相关用例我们做一下优化.

from sofa-rpc-boot-projects.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.