Issue to deserialize string to java util TimeZone
See original GitHub issueI’m having issues making Jackson object mapper deserialize JSON into an object that has a TimeZone field.
com.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot construct instance of
com.fasterxml.jackson.module.mrbean.generated.java.util.TimeZone(although at least one Creator exists): no String-argument constructor/factory method to deserialize from String value ('America/New_York')
Any idea is more than welcome.
Thanks
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
Set Jackson Timezone for Date deserialization - Stack Overflow
I am using Jackson 1.9.7 and I found that doing the following does not solve my serialization/deserialization timezone issue:
Read more >Datetime deserialization is not working (serialization works fine)
I want java Date object to be serialized using following format: "yyyy-MM-dd'T'HH:mm:ss.SSSZ" and read back from a string of the same format during ......
Read more >Learning deserialization of Date with timezone, Jackson ...
The date changing problem occurs when I invokes the Java toString() method for Date object. It uses local host PST timezone, which changed ......
Read more >DeserializationFeature (jackson-databind 2.6.0 API) - FasterXML
Feature that determines whether it is acceptable to coerce non-array (in JSON) values to work with Java collection (arrays, java.util.Collection) types.
Read more >Jackson Date - Baeldung
First, let's see how to serialize a simple java.util. ... getTimeZone("UTC")); String toParse = "01-01-1970 02:30"; Date date ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I found it.
I’ve to register a new instance of objectMapper without MrBean module. There is conflict with it that is culprit for above error.
I created an issue for Mr Bean; and fixed it –
java.util.TimeZone
should work as expected in 2.12.4 / 2.13.0; 2.13.0 will by default prevent materialization of anything underjava.*
(unless we find some big issues with that exclusion).