IvanConrad / google-gson

Automatically exported from code.google.com/p/google-gson
0 stars 0 forks source link

Failed to invoke public org.joda.time.Chronology() with no args #641

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
I can not write properly objects with joda time classes into json. 
Here a piece of code for writing the object to json

------------------------------------------------------------------
Gson gson = new GsonBuilder().serializeNulls().create();
String json = gson .toJson(parseData);
------------------------------------------------------------------

"parseData" is an object that contains not null classes of joda time. Then json 
string is sent to the server. After receiving this string from the server, i 
get the exception

------------------------------------------------------------------
java.lang.RuntimeException: Failed to invoke public org.joda.time.Chronology() 
with no args
------------------------------------------------------------------

in the place:

------------------------------------------------------------------
ParseData parseData = new Gson().fromJson(json, ParseData.class);
------------------------------------------------------------------

Original issue reported on code.google.com by ilyammya...@gmail.com on 16 Jun 2015 at 9:17