Problem with Rocket JsonSerializer

6 views
Skip to first unread message

Sudheer

unread,
Jun 14, 2010, 5:57:26 AM6/14/10
to Google Web Toolkit
Hi,

We are using Rocket api for conversion between JSON to Java objects
and vice versa.

We have created a custom class with all the prerequisites for JSON
serilization. Some of the properties of the class are Strings. Usually
results will come as List of objects of the custom class. When
conversion happens from JSON message to List of objects of custom
class, JsonSerilizer is returning null for a String property that is
actually holding numberic value.

{"name":"test71", "agentLastRunString":"Jun 14, 2010 8:37 AM",
"agentName":"TEST71", "agentRegisteredString":"Jun 14, 2010 8:37 AM",
"agentRestrictions":"JOB-RESTRICTION-NONE", "amAgentStatus":"WS-AM-
NOTINSTALLED", "aspStatus":"WS-ASP-UNKNOWN", "assetTag":"tag1",
"changedString":"Jun 14, 2010 8:37 AM", "createdString":"Jun 14, 2010
8:37 AM", "description":"", "domain":"WACVMSP2-2",
"domainUUID":"D21259A60B6C41A096EE7594D23C6E60", "hostName":"test71",
"hostUUID":"", "ipAddress":"8.8.8.8", "label":"test71",
"macAddress":"12:12:12:12:12:12", "networkAddress":"8.8.8.8",
"operatingSystem":{"name":"Windows Server 2008 Standard Edition"},
"origin":"CA", "protectionStatus":"WS-PT-NOTINSTALLED",
"rcAgentStatus":"WS-RC-NOT-INSTALLED", "scalabilityServer":
{"name":"WACVMSP2-2.ca.com", "hasImage":false}, "sdAgentStatus":"WS-SD-
PREREGISTERED", "serialNumber":12345, "trustLevel":"****",
"userData1":"data10", "userData2":10000, "userData3":"data11",
"userData4":10001, "aVStatus":"WS-AV-UNKNOWN", "hIPSStatus":"WS-HIPS-
UNKNOWN"}

Property 'userData4' is actually holding numeric value as a String,
but when this message is converted to object, 'userData4' is coming as
null. But this works fine when value is in double quotes as String. I
am not sure Why double quotes are removed for a numeric value that is
stored as String.

Any idea why this is happening? I think we no need to override
readObject() method of JsonSerializer.
Reply all
Reply to author
Forward
0 new messages