question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Issue to deserialize string to java util TimeZone

See original GitHub issue

I’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:closed
  • Created 2 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
harishajdareviccommented, Apr 22, 2021

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.

0reactions
cowtowncodercommented, Apr 24, 2021

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 under java.* (unless we find some big issues with that exclusion).

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found