weibocom / motan

A cross-language remote procedure call(RPC) framework for rapid development of high performance distributed services.
Other
5.9k stars 1.78k forks source link

demo跑不起来 #462

Open zhangDa666 opened 7 years ago

zhangDa666 commented 7 years ago

我就是运行com.weibo.motan.demo.client下的DemoRpcClient, 报错:Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'motanDemoReferer': FactoryBean threw exception on object creation; nested exception is com.weibo.api.motan.exception.MotanFrameworkException: error_message: ClusterSupport No service urls for the refer:motan://192.168.0.154:0/motan-demo-rpc/com.weibo.motan.demo.service.MotanDemoService/1.0/referer, registries:[zookeeper://127.0.0.1:2181/com.weibo.api.motan.registry.RegistryService?group=default_rpc], status: 404, error_code: 10101,r=null

rayzhang0603 commented 7 years ago

可以检查一下 1、是否在本地运行了zookeeper 2、server是否正确注册到了本地zookeeper中,并打开了心跳。

如果想简单运行demo,可以把client的注册中心配置为直连方式

 <motan:registry regProtocol="direct" address="${server ip}: ${server port}" name="motanDemo" />
zhuam commented 7 years ago

是不是已经不用了, 我换成 就可以

rayzhang0603 commented 7 years ago

local是本地injvm调用方式,必须client和server在同一个jvm启动,local方式没有网络开销

zhuam commented 7 years ago

明白了,thanks