public static String navigate(final String path, String json){
JsonParser parser = new JsonParser();
JsonObject objJson = (JsonObject) parser.parse(json); //ERROR
return navigate(path, objJson);
}
The JSON is well formatted and I don't have any error with the most of them. But, I get an error when I try to parse some of them.
If I try to reproduce the error with Junit, I don't get any error, so it's just when I package the code and execute it inside of Flume Agent.
24 Oct 2016 07:25:09,556 ERROR [Thread-6] (example.flume.interceptor.paas.KubernetesInterceptor.joinJsons:113) - Error joining jsons. This event will be discarded {"log":"10.1.15.80 - - [24/Oct/2016:07:24:55 +0200] \"GET //server-status/? auto HTTP/1.1\" 200 362 \"-\" \"Go-http-client/1.1\"\n","stream":"stdout","time":"2016-10-24T05:24:55.539699399Z"}
com.google.gson.JsonSyntaxException: com.google.gson.stream.MalformedJsonException: Unterminated string at line 1 column 75
at com.google.gson.internal.Streams.parse(Streams.java:56)
at com.google.gson.JsonParser.parse(JsonParser.java:84)
at com.google.gson.JsonParser.parse(JsonParser.java:59)
at com.google.gson.JsonParser.parse(JsonParser.java:45)
I have checked all the JSON and they seem to have a "?", I don't know if it's the real reasson,,
Any clue about what's going on?