-
Notifications
You must be signed in to change notification settings - Fork 116
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
Issue to deserialize string to java util TimeZone #215
Comments
And this is using the Java 8 module? Reviewing the unit tests might give some idea, and beyond that if you have a code sample showing how the error is arrived at, that would be helpful. |
Hi @kupci Here are is the list of registered modules that is return by objectMapper.findAndRegisterModules()
And sure that I've code here it is: objectMapper.readValue(emailMember.getEmailJson(), EmailRequest.class) where emailMember.getEmailJson() is
and EmailRequest.class
Member class that contain timeZone
|
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. |
There do seem to be some caveats mentioned on the Mr. Bean documentation that might explain this. Anyway, glad you found the conflict. |
If there was an easy way to reproduce this, we could try to see if something could be done to prevent this specific issue. Or, actually, MrBean: I suspect it should never try to materialize anything under "java." or "javax.". And adding such setting (behind a config feature) seems simple enough. |
I created an issue for Mr Bean; and fixed it -- |
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
The text was updated successfully, but these errors were encountered: