Skip to content

Facing issue with latest jackson databind version #659

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

Closed
lio7050 opened this issue Dec 8, 2020 · 2 comments
Closed

Facing issue with latest jackson databind version #659

lio7050 opened this issue Dec 8, 2020 · 2 comments

Comments

@lio7050
Copy link

lio7050 commented Dec 8, 2020

hi,
Recently i have moved to jackson databind version 2.12.0
I am getting issue for localdatetime it was previously running smoothly on older versions. I have also tried few things to resolve the issue like updating other required libraries like datatypeJrs, jdk, etc. But stil getting this below error.

08-12-2020 15:46:46.045:[ERROR]:[a6170cc4-7b8c-421d-b8b2-8bb1929d5849]:[anonymous]:[Exception raised while invoking method :: TenantController.updateTenantById(..) ]
com.fasterxml.jackson.databind.exc.InvalidDefinitionException: Java 8 date/time type java.time.LocalDateTime not supported by default: add Module "com.fasterxml.jackson.datatype:jackson-datatype-jsr310"

Usage as below
protected LocalDateTime expiry;

request as below
{"expiry": "2020-12-18T01:38:11.392021"}
can you please tell me what has changed from previous versions and is this a genuine issue.

@cowtowncoder
Copy link
Member

First of all, this is wrong repository: jackson-core is for streaming component.

As to error: does it not say exactly what is wrong?

You have not added Java 8 date/time module, but are trying to read or write java.time.* values. This will not work appropriately without module (it would try to write them like POJOs; fail to read) so you should either not use these values, or should provide (de)serializers, either by registering this module or adding custom variants.

Change was done via

FasterXML/jackson-databind#2683

based on continuing reports of users accidentally serializing these values as POJOs, then failing to deserialize (because that is not the representation that should be used for date/time values).

@kupci
Copy link
Member

kupci commented Dec 8, 2020

@lio7050 Also, the instructions for adding the required module here: https://github.com/FasterXML/jackson-modules-java8

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

3 participants