Here is the code I tried:
if(rs.next()){
Gson gson = new Gson();
STRUCT st = (STRUCT) rs.getObject(1);
JGeometry j_geom = JGeometry.load(st);
System.out.println(" gson.toJson(j_geom) "+gson.toJson(j_geom));
}
But I am getting this error:
java.lang.IllegalArgumentException: NaN is not a valid double value as per JSON specification. To override this behavior, use GsonBuilder.serializeSpecialDoubleValues() method.
Cannot find a way to sort it out.
Did you try using
GsonBuilder.serializeSpecialFloatingPointValues()? The exception mentionsserializeSpecialDoubleValues(), which does not seem to exist.That JavaDoc states: