Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade jackson dependency to 2.x #21

Open
gilday opened this issue Jan 30, 2017 · 1 comment
Open

Upgrade jackson dependency to 2.x #21

gilday opened this issue Jan 30, 2017 · 1 comment

Comments

@gilday
Copy link
Contributor

gilday commented Jan 30, 2017

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

@bowenli86
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants