dubbo泛化调用 2.7.3版本升到2.7.6版本 泛化调用报null指针

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了dubbo泛化调用 2.7.3版本升到2.7.6版本 泛化调用报null指针相关的知识,希望对你有一定的参考价值。

参考技术A 报错如下;

org.apache.dubbo.rpc.RpcException: Failfast invoke providers dubbo://10.170.112.91:20772/com.fosun.health.open.api.PaymentChannelConfigService?anyhost=true&application=xxl-job-provider&check=false&cluster=failfast&deprecated=false&dubbo=2.0.2&dynamic=true&generic=true&group=cashier&interface=com.fosun.health.open.api.PaymentChannelConfigService&lazy=false&loadbalance=roundrobin&methods=getPayTypesByChannelId&pid=18420&qos.enable=false®ister.ip=10.170.112.91&release=2.7.6&remote.application=cashier-center-core&retries=0&revision=1.0.0&side=consumer&sticky=false×tamp=1609236320490&version=1.0.0 RoundRobinLoadBalance select from all providers [org.apache.dubbo.registry.integration.RegistryDirectory$InvokerDelegate@6ad43d32] for service org.apache.dubbo.rpc.service.GenericService method $invoke on consumer 10.170.112.91 use dubbo version 2.7.3, but no luck to perform the invocation. Last error is: Failed to invoke remote method: $invoke, provider: dubbo://10.170.112.91:20772/com.fosun.health.open.api.PaymentChannelConfigService?anyhost=true&application=xxl-job-provider&check=false&cluster=failfast&deprecated=false&dubbo=2.0.2&dynamic=true&generic=true&group=cashier&interface=com.fosun.health.open.api.PaymentChannelConfigService&lazy=false&loadbalance=roundrobin&methods=getPayTypesByChannelId&pid=18420&qos.enable=false®ister.ip=10.170.112.91&release=2.7.6&remote.application=cashier-center-core&retries=0&revision=1.0.0&side=consumer&sticky=false×tamp=1609236320490&version=1.0.0, cause: org.apache.dubbo.remoting.RemotingException: java.lang.NullPointerException

java.lang.NullPointerException

at org.apache.dubbo.rpc.filter.GenericFilter.invoke(GenericFilter.java:74)

at org.apache.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:81)

at org.apache.dubbo.rpc.filter.ClassLoaderFilter.invoke(ClassLoaderFilter.java:38)

at org.apache.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:81)

at org.apache.dubbo.rpc.filter.EchoFilter.invoke(EchoFilter.java:41)

at org.apache.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:81)

at org.apache.dubbo.rpc.protocol.dubbo.DubboProtocol$1.reply(DubboProtocol.java:145)

at org.apache.dubbo.remoting.exchange.support.header.HeaderExchangeHandler.handleRequest(HeaderExchangeHandler.java:100)

at org.apache.dubbo.remoting.exchange.support.header.HeaderExchangeHandler.received(HeaderExchangeHandler.java:175)

at org.apache.dubbo.remoting.transport.DecodeHandler.received(DecodeHandler.java:51)

at org.apache.dubbo.remoting.transport.dispatcher.ChannelEventRunnable.run(ChannelEventRunnable.java:57)

at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)

at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)

at java.lang.Thread.run(Thread.java:748)

at org.apache.dubbo.rpc.cluster.support.FailfastClusterInvoker.doInvoke(FailfastClusterInvoker.java:59)

at org.apache.dubbo.rpc.cluster.support.AbstractClusterInvoker.invoke(AbstractClusterInvoker.java:248)

at org.apache.dubbo.rpc.cluster.support.wrapper.MockClusterInvoker.invoke(MockClusterInvoker.java:78)

at org.apache.dubbo.rpc.proxy.InvokerInvocationHandler.invoke(InvokerInvocationHandler.java:55)

at org.apache.dubbo.common.bytecode.proxy138.$invoke(proxy138.java)

at com.xxl.job.core.handler.impl.DubboJobHandler.execute(DubboJobHandler.java:73)

at com.xxl.job.core.thread.JobThread.run(JobThread.java:163)

根据报错提示找到该出源码:

是因为dubbo2.7.6版本 没有判断无参方法传null校验导致报空指针错误

以上是关于dubbo泛化调用 2.7.3版本升到2.7.6版本 泛化调用报null指针的主要内容,如果未能解决你的问题,请参考以下文章

dubbo泛化调用使用及原理解析

Dubbo基本特性之泛化调用

dubbo泛化调用

Dubbo 泛化调用在vivo统一配置系统的应用

dubbo之泛化引用

dubbo泛化调用 小demo