If you're using jackson, better to convert directly to ObjectNode.
//not including SerializationFeatures for brevity
static final ObjectMapper mapper = new ObjectMapper();
//pass it your payload
public static ObjectNode convObjToONode(Object o) {
StringWriter stringify = new StringWriter();
ObjectNode objToONode = null;
try {
mapper.writeValue(stringify, o);
objToONode = (ObjectNode) mapper.readTree(stringify.toString());
} catch (IOException e) {
e.printStackTrace();
}
System.out.println(objToONode);
return objToONode;
}