Issue #6 new

GSon date parsing error

conanjb
created an issue

This is more of a question: When I do the following:

client = new UrbanAirshipClient(appkey, appmaster); DeviceTokensResponse dtr = client.getDeviceTokens();

I get the following exception on the date returned by UrbanAirship. I am using Gson 1.4. Do you get this exception? (I've included the Json string returned).

{ "device_tokens_count": 1, "device_tokens": [ { "device_token": "78DFADC3976BF305FAA47751CF9A9704D65DE0B546764B5B657E3D4D8B53E158", "active": true, "alias": null, "last_registration": "2010-07-06 13:24:07" } ], "current_page": 1, "num_pages": 1, "active_device_tokens_count": -3 } Exception in thread "main" com.google.gson.JsonParseException: 2010-07-06 13:24:07 at urbanairship.GsonFactory$CalendarAdapter.deserialize(GsonFactory.java:50) at urbanairship.GsonFactory$CalendarAdapter.deserialize(GsonFactory.java:1) at com.google.gson.JsonDeserializerExceptionWrapper.deserialize(JsonDeserializerExceptionWrapper.java:50) at com.google.gson.JsonDeserializationVisitor.invokeCustomDeserializer(JsonDeserializationVisitor.java:88) at com.google.gson.JsonObjectDeserializationVisitor.visitFieldUsingCustomHandler(JsonObjectDeserializationVisitor.java:117) at com.google.gson.ObjectNavigator.navigateClassFields(ObjectNavigator.java:150) at com.google.gson.ObjectNavigator.accept(ObjectNavigator.java:123) at com.google.gson.JsonDeserializationContextDefault.fromJsonObject(JsonDeserializationContextDefault.java:73) at com.google.gson.JsonDeserializationContextDefault.deserialize(JsonDeserializationContextDefault.java:51) at com.google.gson.DefaultTypeAdapters$CollectionTypeAdapter.deserialize(DefaultTypeAdapters.java:472) at com.google.gson.DefaultTypeAdapters$CollectionTypeAdapter.deserialize(DefaultTypeAdapters.java:435) at com.google.gson.JsonDeserializerExceptionWrapper.deserialize(JsonDeserializerExceptionWrapper.java:50) at com.google.gson.JsonDeserializationVisitor.invokeCustomDeserializer(JsonDeserializationVisitor.java:88) at com.google.gson.JsonObjectDeserializationVisitor.visitFieldUsingCustomHandler(JsonObjectDeserializationVisitor.java:117) at com.google.gson.ObjectNavigator.navigateClassFields(ObjectNavigator.java:150) at com.google.gson.ObjectNavigator.accept(ObjectNavigator.java:123) at com.google.gson.JsonDeserializationContextDefault.fromJsonObject(JsonDeserializationContextDefault.java:73) at com.google.gson.JsonDeserializationContextDefault.deserialize(JsonDeserializationContextDefault.java:51) at com.google.gson.Gson.fromJson(Gson.java:495) at com.google.gson.Gson.fromJson(Gson.java:444) at com.google.gson.Gson.fromJson(Gson.java:396) at com.google.gson.Gson.fromJson(Gson.java:372) at urbanairship.UrbanAirshipClient.fromJson(UrbanAirshipClient.java:635)