weibocom / motan

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

报出provider not exist serviceKey异常? #455

Open coder-aiden opened 7 years ago

coder-aiden commented 7 years ago
com.weibo.api.motan.exception.MotanServiceException: error_message: ProviderProtectedMessageRouter handler Error: provider not exist serviceKey=meipian-service/com.meipian.service.push.contract.IPushService/1.0 requestId=1569624596068433921 interface=com.meipian.service.push.contract.IPushService method=pushGroup(java.util.List,com.meipian.service.push.bean.PushContent), status: 503, error_code: 10001,r=null
    at com.weibo.api.motan.transport.ProviderMessageRouter.handle(ProviderMessageRouter.java:82)
    at com.weibo.api.motan.transport.support.DefaultRpcHeartbeatFactory$HeartMessageHandleWrapper.handle(DefaultRpcHeartbeatFactory.java:82)
    at com.weibo.api.motan.transport.netty.NettyChannelHandler.processRequest(NettyChannelHandler.java:139)
    at com.weibo.api.motan.transport.netty.NettyChannelHandler.access$000(NettyChannelHandler.java:47)
    at com.weibo.api.motan.transport.netty.NettyChannelHandler$1.run(NettyChannelHandler.java:116)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)

服务提供方是这样提供的:

    @Override
    public void pushGroup(final List<Integer> userIds, final PushContent content) throws Exception {

        FixedThreadManager.getInstance().execute(new Runnable() {
            @Override
            public void run() {
                PushEntity entity = PushEntity.builder(userIds, content, TimeUtils.getCurrentTime(), 0);
                try {
                    xgPush.pushNotification(entity, true);
                } catch (Exception e) {
                    e.printStackTrace();
                }

                userPushService.save(entity);
            }

        });

    }

其他的都好使,就这个方法不行。请问这是为什么?

rayzhang0603 commented 7 years ago

servicekey是由${group}/${interfaceName}/${version}组成,可以先检查group、interface、version是否和server端配置的一样。 也可以在server端启动的info日志,查看‘RequestRouter addProvider’关键词,看看server端有没有注册对应的服务。

coder-aiden commented 7 years ago

已经解决了。 @rayzhang0603 不同的jar包的发布端口必须不一样吗?

rayzhang0603 commented 7 years ago

motan:service配置都配置上shareChannel="true"时可以配置相同端口。限制为协议、序列化等参数必须一致

coder-aiden commented 7 years ago

Thanks!

coder-aiden commented 7 years ago

好像不行。不同的jar包没法发布同一个机器的不同端口