soda-java icon indicating copy to clipboard operation
soda-java copied to clipboard

Upgrade jackson dependency to 2.x

Open gilday opened this issue 8 years ago • 1 comments

I authored some classes with Jackson annotations which included references to Socrata classes such as Location. I couldn't figure out why I was getting the following exception:

Caused by: com.sun.jersey.api.client.ClientHandlerException: com.fasterxml.jackson.databind.JsonMappingException: Can not construct instance of com.socrata.model.Location: no suitable constructor found, can not deserialize from Object value (missing default constructor or creator, or perhaps need to add/enable type information?)
 at [Source: sun.net.www.protocol.http.HttpURLConnection$HttpInputStream@1d220bf1; line: 12, column: 5] (through reference chain: java.util.ArrayList[1]->com.johnathangilday.ingest.Arrest["location_1"])
	at com.sun.jersey.api.client.ClientResponse.getEntity(ClientResponse.java:563)
	at com.sun.jersey.api.client.ClientResponse.getEntity(ClientResponse.java:523)
	at com.socrata.api.Soda2Consumer.query(Soda2Consumer.java:112)

I believe this happens because my classes are decorated with Jackson 2.x annotations using the fasterxml packages, but Socrata classes are decorated with the long deprecated (years) Jackson 1.x annotations using the codehaus packages

gilday avatar Jan 30 '17 20:01 gilday

Yes, jackson 1.x and 2.x are incompatible, though they share very similar interfaces

bowenli86 avatar Feb 13 '17 23:02 bowenli86