Hi Jinmei-

Yes, I have confirmed the same thing.  I have tried specifying a
value-class (type) information, but that did not work either...

gfsh>debug --state=ON
Debug is ON

gfsh>get --region=/Example --key=key1
--value-class=J[java.lang.Integer.TYPE;Exception occurred. null
java.lang.NullPointerException
    at org.json.JSONObject.populateMap(JSONObject.java:962)
    at org.json.JSONObject.<init>(JSONObject.java:279)
    at
com.gemstone.gemfire.management.internal.cli.json.GfJsonObject.<init>(GfJsonObject.java:73)
    at
com.gemstone.gemfire.management.internal.cli.json.GfJsonObject.getJSONObject(GfJsonObject.java:184)
    at
com.gemstone.gemfire.management.internal.cli.CommandResponse$Data.<init>(CommandResponse.java:150)
    at
com.gemstone.gemfire.management.internal.cli.CommandResponse.<init>(CommandResponse.java:64)
    at
com.gemstone.gemfire.management.internal.cli.CommandResponseBuilder.prepareCommandResponseFromJson(CommandResponseBuilder.java:63)
    at
com.gemstone.gemfire.management.internal.cli.shell.GfshExecutionStrategy.executeOnRemote(GfshExecutionStrategy.java:252)
    at
com.gemstone.gemfire.management.internal.cli.shell.GfshExecutionStrategy.execute(GfshExecutionStrategy.java:100)
    at
org.springframework.shell.core.AbstractShell.executeCommand(AbstractShell.java:127)
    at
com.gemstone.gemfire.management.internal.cli.shell.Gfsh.promptLoop(Gfsh.java:891)
    at org.springframework.shell.core.JLineShell.run(JLineShell.java:179)
    at java.lang.Thread.run(Thread.java:745)

Perhaps it is time *Gfsh* switched to Jackson rather than the *JSONObject*
API, which is half-baked at best.

-John


On Thu, Jul 28, 2016 at 9:53 PM, Jinmei Liao <jil...@pivotal.io> wrote:

> While debugging into Geode, I ran into a problem of putting an array of
> primitives as the value of a region entry. I have a java client that would
> do a put with this:
>
> int[] testValues = {1, 2, 3};
> region.put("key1", testValues);
>
> Once the data in the server, I used gfsh to a get "get --key=key1
> --region=testRegion", I get an error as the result. Turns out the server
> has problem turning the primitive arrays into the json strings that would
> be sent back to gfsh. Is it always like this? What should be the expected
> behavior?
>
> Thanks!
>
> --
> Cheers
>
> Jinmei
>



-- 
-John
503-504-8657
john.blum10101 (skype)

Reply via email to