Skip to content
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

Sub-optimal exception message when failing to deserialize non-static inner classes #2520

Closed
mark-- opened this issue Oct 24, 2019 · 2 comments
Milestone

Comments

@mark--
Copy link

mark-- commented Oct 24, 2019

When I try to deserialize an Object which contains an non-static inner class the following error occurs:

Caused by: com.fasterxml.jackson.databind.exc.MismatchedInputException:
Cannot construct instance of `outerclass$innerclass` (although at least one Creator exists):
can only instantiate non-static inner class by using default, no-argument constructor

I am using version 2.10.0.

In the last line 'non-static' must be 'static'.

@cowtowncoder
Copy link
Member

Thank you for reporting this, will fix.

@cowtowncoder cowtowncoder modified the milestones: 2.10.0, 2.10.1 Oct 24, 2019
@cowtowncoder
Copy link
Member

Actually. No, that is not true. This specifically refers to non-static inner classes (static ones can be instantiated using other mechanism).

But I will try to improve wording to make meaning clear, so it's a good report still. :)

@cowtowncoder cowtowncoder changed the title Error in Exception Message Sub-optimal exception message when failing to deserialize non-static inner classes Oct 24, 2019
@cowtowncoder cowtowncoder removed the 2.10 label Apr 12, 2020
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

2 participants