-
-
Notifications
You must be signed in to change notification settings - Fork 222
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
XmlMapper
2.12 regression: no default no-arg ctor found
#491
Comments
Do you think this might be due to: FasterXML/jackson-databind#3220 which I am planning on releasing as part of 2.12.5? I am trying to figure out when to release that patch as there are only 2 fixes all in all -- but this fix is sort of critical. Also: is this separate from JSON handling? |
I am able to reproduce the failure with the following dependencies:
Yes, |
Given the snapshot, I assume 2.13.0-rc2 has the same behavior. But how about 2.12.5 that was just released last night? Also: is it possible to reproduce this without mix-ins? |
|
… (#492) Co-authored-by: Volkan Yazıcı <volkan@yazi.ci>
Thank you for providing the test: I will try to get to this as soon as possible; hectic week at work but this is on my radar. |
Sigh. Things get rather complicated, with root-level polymorphic value. Will try to see what gives; looks like the default empty String |
Ok, yes, mix-ins are not related here. Some notes:
So while I will try to address this, I would suggest adding such constructor for this specific case, to work-around the problem. |
Ok. I added some notes on the failing test. This is not an easy problem to solve; basically there seems to be 2 ways to work around it. Either:
Of these (2) would work better and would probably be the way to go. I don't have time to pursue this quite now, but wanted to add a note if anyone else might want to try it. Other than this, adding the no-arguments constructor also works around the issue. |
|
@henrik242 Yes. Why wouldn't it? This is an open issue, with failing test. |
@cowtowncoder Do you know if there are plans on fixing this issue? We're still on 2.11.4 :/ |
@henrik242 I haven't had any time to work on this. But there is a reproduction (failing unit test), and it looks like this might have same root cause as #538; so I understand the issue but have no good plan for solving it. |
XmlMapper
2.12 regression: no default no-arg ctor found
@henrik242 Oh wow. We got lucky -- I was able to figure out a simpleish way to fix this, in a way reverting handling of root-element to pre-2.12 state now that 2.13 has other features allow coercion. I hope there aren't other regressions for things without test coverage, but this particular issue will be fixed in 2.14.0. |
Amazing! Thanks for the effort! |
You are welcome! Thank you for the ping, was well timed :) |
@cowtowncoder I've found an additional issue where this fails. Check This runs fine in 2.11.3, but fails in 2.14.0-rc1 |
@henrik242 Could you please file a new separate issue? I typically do not re-open issues if there's a released version marked with a fix. |
@cowtowncoder Sure, posted in #547 EDIT: By the way, I just realized that this is the exact same issue that I reported in FasterXML/jackson-module-kotlin#396 two years ago. This is still covered by https://github.com/FasterXML/jackson-integration-tests/blob/master/src/test/kotlin/com/fasterxml/jackson/failing/Jackson212MissingConstructorTest.kt |
As described first in FasterXML/jackson-module-kotlin#396, 2.12.0 has introduced a regression to the
XmlMapper
. I have managed to reproduce the regression in the below Java snippet, which works on 2.11.4, but fails on 2.12.{0..4}:Both tests pass on 2.11.4, whereas, on 2.12.{0..4},
test_empty_Problem_JSON_deserialization()
passes andtest_empty_Problem_XML_deserialization()
fails with the following message:In order to make
test_empty_Problem_XML_deserialization()
pass on 2.12.{0..4}, one needs to add a no-arg ctor toDefaultProblem
.The text was updated successfully, but these errors were encountered: