I have a nested JSON as payload.
For example,
{
"source_ip": "1.2.3.4",
"source_type":null,
"creation_time":"1415296951",
"criticality":"4",
"raw":{"ACKNOWLEDGED":"false"}
}
I am using GSON to deserialize the payload.
I am having trouble with the nested part. "raw":{"ACKNOWLEDGED":"false"}
In my gson structure, I was trying to define it as
private JSONObject raw;
But this seem to throw a exception -
Exception in thread "ThreadJob"
org.codehaus.jackson.map.JsonMappingException: No serializer found for
class org.json.JSONObject and no properties discovered to create
BeanSerializer (to avoid exception, disable
SerializationConfig.Feature.FAIL_ON_EMPTY_BEANS) ) (through reference
chain:
java.util.HashMap["event"]->samza.examples.wikipedia.system.ArgosAlert["raw"])
Appreciate if someone could point out how to handle this.
- Shekar