Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Call Dubbo Service return NullPointerException #3496

Closed
2 tasks
liu2510865 opened this issue Feb 18, 2019 · 8 comments
Closed
2 tasks

Call Dubbo Service return NullPointerException #3496

liu2510865 opened this issue Feb 18, 2019 · 8 comments

Comments

@liu2510865
Copy link

  • I have searched the issues of this repository and believe that this is not a duplicate.
  • I have checked the FAQ of this repository and believe that this is not a duplicate.

Environment

Steps to reproduce this issue

  1. call api throw null exception

What actually happens?

If there is an exception, please attach the exception trace:

java.lang.NullPointerExceptionat sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)at java.lang.reflect.Constructor.newInstance(Constructor.java:423)at com.alibaba.com.caucho.hessian.io.JavaDeserializer.instantiate(JavaDeserializer.java:271)at com.alibaba.com.caucho.hessian.io.JavaDeserializer.readObject(JavaDeserializer.java:155)at com.alibaba.com.caucho.hessian.io.SerializerFactory.readObject(SerializerFactory.java:397)at com.alibaba.com.caucho.hessian.io.Hessian2Input.readObjectInstance(Hessian2Input.java:2070)at com.alibaba.com.caucho.hessian.io.Hessian2Input.readObject(Hessian2Input.java:2005)at com.alibaba.com.caucho.hessian.io.Hessian2Input.readObject(Hessian2Input.java:1990)at com.alibaba.dubbo.common.serialize.support.hessian.Hessian2ObjectInput.readObject(Hessian2ObjectInput.java:88)at com.alibaba.dubbo.rpc.protocol.dubbo.DecodeableRpcResult.decode(DecodeableRpcResult.java:92)at com.alibaba.dubbo.rpc.protocol.dubbo.DecodeableRpcResult.decode(DecodeableRpcResult.java:109)at com.alibaba.dubbo.rpc.protocol.dubbo.DubboCodec.decodeBody(DubboCodec.java:97)at com.alibaba.dubbo.remoting.exchange.codec.ExchangeCodec.decode(ExchangeCodec.java:126)at com.alibaba.dubbo.remoting.exchange.codec.ExchangeCodec.decode(ExchangeCodec.java:87)at com.alibaba.dubbo.rpc.protocol.dubbo.DubboCountCodec.decode(DubboCountCodec.java:46)at com.alibaba.dubbo.remoting.transport.netty.NettyCodecAdapter$InternalDecoder.messageReceived(NettyCodecAdapter.java:134)at org.jboss.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:80)at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564)at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:559)at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:274)at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:261)at org.jboss.netty.channel.socket.nio.NioWorker.read(NioWorker.java:349)at org.jboss.netty.channel.socket.nio.NioWorker.processSelectedKeys(NioWorker.java:280)at org.jboss.netty.channel.socket.nio.NioWorker.run(NioWorker.java:200)at org.jboss.netty.util.ThreadRenamingRunnable.run(ThreadRenamingRunnable.java:108)at org.jboss.netty.util.internal.DeadLockProofWorker$1.run(DeadLockProofWorker.java:44)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)
@Bricks-Man
Copy link
Contributor

Could you push a demo for this issue?Without demo, it is difficult to reproduce this problem.

@carryxyh
Copy link
Member

Hi @liu2510865 , does your params have a no-args Constructor (private or public) ?

@liu2510865
Copy link
Author

Hi @carryxyh

The calling method is as follows:

image

@carryxyh
Copy link
Member

Yeah, but can u check whether your rpc param has a no-args Constructor?
I just find a xxxMap in your pic..

@liu2510865
Copy link
Author

@carryxyh
this is interface statement
image

Provider:
<dubbo:provider delay="-1"/> <dubbo:registry protocol="zookeeper" address="${dubbo.registry.address}"/> <dubbo:protocol name="dubbo" port="20891" threads="300"/> <dubbo:consumer timeout="10000" check="false"/>
<dubbo:service interface="com.alfred.mobile_service.service.payment.AppPaymentSettlementService" ref="appPaymentSettlementService"/>

@carryxyh
Copy link
Member

It seems that you can store any object in your map.
Please check if they all have a parameterless constructor.

@liu2510865
Copy link
Author

@carryxyh

I solved this problem ,is caused by a business exception in the service.

thanks

@carryxyh
Copy link
Member

OK. I'd like close this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants