-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Java 8 date/time type java.time.LocalDateTime
not supported by default
#3164
Comments
This is intentional, see #2683: Java 8 date/time values should NOT be serialized as POJOs by default because that representation has caused lots of issues -- it cannot be read back. |
Just saw as well your comment on #3091. Thanks |
@esfomeado Ah, yes. Did the code sample use |
Hey, nice chit-chat between you two, but how to fix this one after all? I've added the dependency to POM as was required, but still it's not working! |
ObjectMapper.registerModule..... |
Thanks, found this one already. |
I dont understand why but it is not working for me!! |
@gautamkumargojoko were you able to solve this? |
after adding this to Config file
and added these annotations :
then it worked for me |
It should NOT be necessary -- and I would recommend against -- add |
I had tried but unfortunately it did not work for me !! @cowtowncoder |
Is there any follow-up above? I also upgraded to version 2.13 and proactively registered:
But it still doesn't work and throws an exception:
|
It should work with Java8 module registered. Try checking ur Spring configuration/bean settings. Or try de/serializing directly in 'objectMapper()' method. |
@zhaishudong This sounds like a Spring configuration problem: Jackson cannot really do anything there. You may want to ask on Spring support forums. |
Describe the bug
I have upgrade Jackson from 2.11.4 to 2.12.3 and not I get this exception:
Now I have to explicitly register the JavaTimeModule(). Is there any behavior change?
Thanks
Version information
2.12.3
To Reproduce
https://github.com/esfomeado/jackson-test
Java 8
Expected behavior
Should work the same way has the previous version.
Additional context
Spring Boot 2.5
The text was updated successfully, but these errors were encountered: