Automatically exported from code.google.com/p/nfs-rpc
nfs
Automatically exported from code.google.com/p/nfs-rpc
Hi Davy,
When i using Reflection Type to call method with no arguments, it will be
thrown NullPointerException. More log info as below.
2012-07-13 17:59:52,874 [main] ERROR code.google.nfs.rpc.protocol.RPCProtocol
-encode request object error
java.lang.NullPointerException
at code.google.nfs.rpc.protocol.RPCProtocol.encode(RPCProtocol.java:104)
at code.google.nfs.rpc.protocol.ProtocolUtils.encode(ProtocolUtils.java:35)
at code.google.nfs.rpc.netty.serialize.NettyProtocolEncoder.encode(NettyProtocolEncoder.java:22)
at org.jboss.netty.handler.codec.oneone.OneToOneEncoder.handleDownstream(OneToOneEncoder.java:66)
at org.jboss.netty.channel.DefaultChannelPipeline.sendDownstream(DefaultChannelPipeline.java:591)
at org.jboss.netty.channel.DefaultChannelPipeline.sendDownstream(DefaultChannelPipeline.java:582)
at org.jboss.netty.channel.Channels.write(Channels.java:611)
at org.jboss.netty.channel.Channels.write(Channels.java:578)
at org.jboss.netty.channel.AbstractChannel.write(AbstractChannel.java:251)
at code.google.nfs.rpc.netty.client.NettyClient.sendRequest(NettyClient.java:47)
at code.google.nfs.rpc.client.AbstractClient.invokeSyncIntern(AbstractClient.java:69)
at code.google.nfs.rpc.client.AbstractClient.invokeSync(AbstractClient.java:55)
at code.google.nfs.rpc.client.AbstractClientInvocationHandler.invoke(AbstractClientInvocationHandler.java:73)
at $Proxy0.sayHello(Unknown Source)
at MyNettyClient.main(MyNettyClient.java:29)
2012-07-13 17:59:52,877 [main] ERROR .nfs.rpc.netty.client.NettyClientHandler
-catch some exception not IOException
java.lang.NullPointerException
at code.google.nfs.rpc.protocol.RPCProtocol.encode(RPCProtocol.java:104)
at code.google.nfs.rpc.protocol.ProtocolUtils.encode(ProtocolUtils.java:35)
at code.google.nfs.rpc.netty.serialize.NettyProtocolEncoder.encode(NettyProtocolEncoder.java:22)
at org.jboss.netty.handler.codec.oneone.OneToOneEncoder.handleDownstream(OneToOneEncoder.java:66)
at org.jboss.netty.channel.Channels.write(Channels.java:611)
at org.jboss.netty.channel.Channels.write(Channels.java:578)
at org.jboss.netty.channel.AbstractChannel.write(AbstractChannel.java:251)
at code.google.nfs.rpc.netty.client.NettyClient.sendRequest(NettyClient.java:47)
at code.google.nfs.rpc.client.AbstractClient.invokeSyncIntern(AbstractClient.java:69)
at code.google.nfs.rpc.client.AbstractClient.invokeSync(AbstractClient.java:55)
at code.google.nfs.rpc.client.AbstractClientInvocationHandler.invoke(AbstractClientInvocationHandler.java:73)
at $Proxy0.sayHello(Unknown Source)
at MyNettyClient.main(MyNettyClient.java:29)
--------------------------------------------------------------
I have temporarily fixed this issue by adding a NULL checking as below you can
see.
Object[] requestObjects = wrapper.getRequestObjects();
if(requestObjects!=null){
for (Object requestArg : requestObjects) {
byte[] requestArgByte = Codecs.getEncoder(wrapper.getCodecType()).encode(requestArg);
requestArgs.add(requestArgByte);
requestArgsLen += requestArgByte.length;
}
}
Original issue reported on code.google.com by [email protected]
on 13 Jul 2012 at 10:20
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.