Forum: Building VoltDB Clients

Post: Passing Nulls via JSON

Passing Nulls via JSON
jeff_i
Jul 14, 2010
I am getting an error when sending a null (valid use case) value for a field.
org.voltdb.VoltTypeException: Unimplemented Object Type: class org.json.JSONObject$Null
Is this a bug or is there an other way to handle passing null values to the stored procs via json?
Possibly a bug
jhugg
Jul 15, 2010
I don't think you should be seeing that message. Can you tell me a little bit more so I can try to reproduce it?
What is the type of the parameter you're trying to pass?
What does the JSON look like that you are sending to the server?
Is there any interesting context to that error message?
Do you know what SVN revision you are using, or where you got the build?
Thanks for trying this out Jeff. We'll try to get you patched up.
Thanks jhugg, >>What is the
jeff_i
Jul 15, 2010
Thanks jhugg,
>>What is the type of the parameter you're trying to pass?
parameter type is a string, databse type is varchar
>>What does the JSON look like that you are sending to the server?
here is the php var_dump, consider value in [2] - when I change it to an empty string , all goes well
array(24) {
[0]=>
string(13) "4c3f1f342ece5"
[1]=>
string(9) "XLEHCKHJS"
[2]=>
NULL
[3]=>
string(8) "Gkgcmusl"
[4]=>
string(17) "AKUDNVTE@KBNQ.com"
[5]=>
string(7) "Katzsqg"
[6]=>
string(7) "Zwtvjpn"
[7]=>
string(14) "6962 Pvp Court"
[8]=>
string(4) "Vhbn"
[9]=>
string(2) "CO"
[10]=>
string(5) "48395"
[11]=>
int(949392000)
[12]=>
string(5) "en_US"
[13]=>
string(19) "America/Los_Angeles"
[14]=>
int(1)
[15]=>
int(1279205172)
[16]=>
string(10) "9456235589"
[17]=>
string(10) "1497657414"
[18]=>
string(10) "3373887626"
[19]=>
string(10) "2117739287"
[20]=>
string(18) "http://foo.com"
[21]=>
string(18) "http://foo.com"
[22]=>
string(13) "4c3f1f342ece5"
[23]=>
int(1279205172)
}
>>Is there any interesting context to that error message?
trace from the volt console:
org.voltdb.VoltTypeException: Unimplemented Object Type: class org.json.JSONObject$Null
at org.voltdb.VoltType.typeFromClass(VoltType.java:233)
at org.voltdb.ParameterSet.writeExternal(ParameterSet.java:191)
at org.voltdb.messaging.FastSerializer.writeObject(FastSerializer.java:255)
at org.voltdb.client.ProcedureInvocation.writeExternal(ProcedureInvocation.java:64)
at org.voltdb.messaging.FastSerializer.writeObjectForMessaging(FastSerializer.java:174)
at org.voltdb.client.Distributer.queue(Distributer.java:541)
at org.voltdb.client.ClientImpl.callProcedure(ClientImpl.java:205)
at org.voltdb.client.ClientImpl.callProcedure(ClientImpl.java:166)
at org.voltdb.HTTPClientInterface.process(HTTPClientInterface.java:50)
at org.voltdb.utils.HTTPAdminListener.serve(HTTPAdminListener.java:40)
at org.voltdb.utils.NanoHTTPD$HTTPSession.run(NanoHTTPD.java:371)
at java.lang.Thread.run(Thread.java:636)
Do you know what SVN revision you are using, or where you got the build?
>>I pulled from the trunk as soon as the json client became available, version.text says: 1.0.01
Fixed,
jhugg
Jul 15, 2010
Thanks jhugg,
>>What is the type of the parameter you're trying to pass?
parameter type is a string, databse type is varchar
>>What does the JSON look like that you are sending to the server?
here is the php var_dump, consider value in [2] - when I change it to an empty string , all goes well
array(24) {
[0]=>
string(13) "4c3f1f342ece5"
[1]=>
string(9) "XLEHCKHJS"
[2]=>
NULL
[3]=>
string(8) "Gkgcmusl"
[4]=>
string(17) "AKUDNVTE@KBNQ.com"
[5]=>
string(7) "Katzsqg"
[6]=>
string(7) "Zwtvjpn"
[7]=>
string(14) "6962 Pvp Court"
[8]=>
string(4) "Vhbn"
[9]=>
string(2) "CO"
[10]=>
string(5) "48395"
[11]=>
int(949392000)
[12]=>
string(5) "en_US"
[13]=>
string(19) "America/Los_Angeles"
[14]=>
int(1)
[15]=>
int(1279205172)
[16]=>
string(10) "9456235589"
[17]=>
string(10) "1497657414"
[18]=>
string(10) "3373887626"
[19]=>
string(10) "2117739287"
[20]=>
string(18) "http://foo.com"
[21]=>
string(18) "http://foo.com"
[22]=>
string(13) "4c3f1f342ece5"
[23]=>
int(1279205172)
}
>>Is there any interesting context to that error message?
trace from the volt console:
org.voltdb.VoltTypeException: Unimplemented Object Type: class org.json.JSONObject$Null
at org.voltdb.VoltType.typeFromClass(VoltType.java:233)
at org.voltdb.ParameterSet.writeExternal(ParameterSet.java:191)
at org.voltdb.messaging.FastSerializer.writeObject(FastSerializer.java:255)
at org.voltdb.client.ProcedureInvocation.writeExternal(ProcedureInvocation.java:64)
at org.voltdb.messaging.FastSerializer.writeObjectForMessaging(FastSerializer.java:174)
at org.voltdb.client.Distributer.queue(Distributer.java:541)
at org.voltdb.client.ClientImpl.callProcedure(ClientImpl.java:205)
at org.voltdb.client.ClientImpl.callProcedure(ClientImpl.java:166)
at org.voltdb.HTTPClientInterface.process(HTTPClientInterface.java:50)
at org.voltdb.utils.HTTPAdminListener.serve(HTTPAdminListener.java:40)
at org.voltdb.utils.NanoHTTPD$HTTPSession.run(NanoHTTPD.java:371)
at java.lang.Thread.run(Thread.java:636)
Do you know what SVN revision you are using, or where you got the build?
>>I pulled from the trunk as soon as the json client became available, version.text says: 1.0.01


This should be fixed in r788. See https://issues.voltdb.com/browse/ENG-641. Sorry about that. Let me know if it doesn't work for you.