samza-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Shekar Tippur <ctip...@gmail.com>
Subject Having trouble deserializing nested json payload
Date Mon, 08 Dec 2014 10:53:24 GMT
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

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message