jnan77 / jsonrpc4j

Automatically exported from code.google.com/p/jsonrpc4j
0 stars 0 forks source link

Default value for returnType argument didn't set #24

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Null Pointer Exception appears when you try to call 
JsonRpcHttpClient::invoke(String methodName, Object[] arguments)

For more information please take a look to stack trace bellow:

java.lang.NullPointerException
        at org.codehaus.jackson.map.type.TypeFactory._constructType(TypeFactory.java:477)
        at org.codehaus.jackson.map.type.TypeFactory.type(TypeFactory.java:130)
        at com.googlecode.jsonrpc4j.JsonRpcClient.readResponse(JsonRpcClient.java:201)
        at com.googlecode.jsonrpc4j.JsonRpcHttpClient.invoke(JsonRpcHttpClient.java:145)

Thanks,

Original issue reported on code.google.com by kamenski...@gmail.com on 4 May 2012 at 12:40

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
What is handling the server end of things?  Apparently the server end is 
returning a value but the client isn't excepting it to.  Here's the client code:

        if (jsonObject.has("result")
            && !jsonObject.get("result").isNull()
            && jsonObject.get("result")!=null) {
            return mapper.readValue( 
                jsonObject.get("result"), TypeFactory.type(returnType));
        }

I'll add a check for returnType and make it log a warning.

Either way, you should post what your server end is replying with.  There could 
be problems with your configuration.

Original comment by brian.di...@gmail.com on 21 May 2012 at 8:10

GoogleCodeExporter commented 8 years ago
please check latest SNAPSHOT version

Original comment by brian.di...@gmail.com on 21 May 2012 at 8:11

GoogleCodeExporter commented 8 years ago

Original comment by brian.di...@gmail.com on 25 May 2012 at 2:51