-
Notifications
You must be signed in to change notification settings - Fork 174
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
2.12.x regression: no default no-arguments constructor found #396
Comments
@cowtowncoder Have you seen this? Looking forward to rc2 😄 |
@henrik242 To make sure this is categorized correctly, are you sure this should be here in jackson-dataformat-xml? Or should it go under jackson-module-kotlin?
|
@henrik242 Had not noticed it. As per @kupci's comment I suspect this might not Kotlin-specific, so I'll try to see if I can reproduce with XML and Java. I would expect test to probably fail for different reason: instead of |
Actually, no, I would need a plain Java reproduction -- I am guessing this may well be due to problem with Test itself could be added under So, the issue very likely has to do with the way Kotlin module's mapping of data classes to creators; in this case creator would have to be "delegating", not properties-based, looking at structure. I don't know how it might have worked before but I do not think there is a way to make that structure map as expected with properties-style constructors. |
Example works with Java definitions like:
and the distinction is that the outer POJO requires properties-based creator (since there is propert "stuff"), whereas inner POJO requires delegate-based as it must map straight from String value. So I don't see a bug in XML format module, and suspect that challenge is that of annotating |
@cowtowncoder Should I re-post this issue in the Kotlin module? Or add a PR to https://github.com/FasterXML/jackson-integration-tests ? Or maybe both? |
@henrik242 I think I'll first transfer this to Kotlin module, for maintainers to see. |
@cowtowncoder @dinomite The 2.12 release fails with this issue now. |
What is the timeline for 2.12.1 release and can we add this to the test coverage to prevent regression |
Typically first .1 patch follows in about 1 month of the .0, depending on accumulation of fixes. As to regression test: if the test requires both XML and Kotlin modules, it should to go in: https://github.com/FasterXML/jackson-integration-tests to avoid adding cross-component dependencies (beyond existing compile-time dependencies to core components). This assuming it is not possible to reproduce this without xml module (or kotlin module). |
@cowtowncoder @michaelbrewer @dinomite I've added an integration test for this now |
@cowtowncoder We actually already have the I haven't dug into what's actually going wrong, happy to take tips or PRs against that branch for a fix. |
@dinomite Ok. I guess that's fine then -- means that I will need to make sure to always publish XML module before Kotlin one, but that is reasonable from ordering perspective. |
Hmm, that's a good point so maybe it should be in the integration tests. Is the error only happening with the XML module in conjunction with the Kotlin module? |
Yes, AFAIK |
Just dropping in to mention that the branch is open with the test case, awaiting a fix: #401 |
@dinomite it should be possible to add currently failing tests under |
Good idea, I'll move that test into the failing tests group |
@henrik242 Thanks for keeping an eye on this, please report back once you've had a chance to check out 2.12.5 |
2.12.5 is out, but if if 2.13.0-rc2 fails, I suspect the issue is still there. |
For me the issue is still there with 2.12.5 |
No reason for everyone to run their own personal tests, just run the one in jackson-integration-tests:
|
@vy I created a pull request with your test in jackson-integration-tests, hope that's ok! FasterXML/jackson-integration-tests#12 EDIT: Never mind, I saw just noticed that you added it yourself in FasterXML/jackson-integration-tests#10 Sorry! :) |
Test added in jackson-module-xml FasterXML/jackson-dataformat-xml#492 |
Just as a note to myself (and others following this), this bug is now being tracked in FasterXML/jackson-dataformat-xml#491 It can be reproduced with |
@henrik242 Thanks for following up with that—such links of information are very helpful. |
Fixed in 2.15.0: FasterXML/jackson-dataformat-xml#547 need to change "failing failing test" now |
@cowtowncoder Amazing, thanks for the great work! Fingers crossed for an imminent 2.15.0 release 🤞😊 Here's another test that's probably fixed too, btw: https://github.com/FasterXML/jackson-integration-tests/blob/master/src/test/kotlin/com/fasterxml/jackson/failing/Jackson212MissingConstructorTest.kt And maybe this is related? https://github.com/FasterXML/jackson-dataformat-xml/blob/master/src/test/java/tools/jackson/dataformat/xml/failing/NoArgCtorDeser491Test.java |
@henrik242 I think release will be sooner than I originally planned, due to one particular CVE. But I think we are still out by at least a month since first release candidate. Still, lots of good fixes esp. for Java record types, for 2.15. |
@cowtowncoder No problem :) I see that the (I also had to do a |
@henrik242 Hmmh. Ok, I got Scala module snapshot resolved (should now push snapshots automatically with fix @pjfanning did). But I have always hard time running Kotlin-tests from Eclipse... not sure how to get that to work. |
@cowtowncoder Cool, I can probably make an issue of it then. Can't you just make Eclipse trigger |
I can't get Eclipse to read Kotlin projects in a way that it recognizes Kotlin classes, unfortunately. |
Weird. It works out of the box in IntelliJ IDEA. Haven't used Eclipse in ages, so I can't help there :/ EDIT: I tried the latest Eclipse IDE, but couldn't get it to work. The kotlin plugin had problems that I was unable to resolve, and the scala plugin isn't supported anymore. |
Understood. I can try with Idea, I have a free copy I think. Then again even if I can reproduce the failure not sure I can do much to fix it, but just to acknowledge. I guess I could at least re-open this issue & remove "fixed" entry from release notes. |
Forgot to update: had absolutely no problem running Kotlin test from Idea. I added notes on integration test over at: FasterXML/jackson-integration-tests#14 but basically I think things actually work as expected from Jackson perspective (no more exception, outcomes as expected I think); so what need is:
@henrik242 Let me know what you think. |
Sounds like things are now resolved, as per testing, verification. So wrt 2.15.0 (not yet released) this should work. |
Related problem: #721 Fails as of 2.12.3 and later (including 2.16.0-rc1) |
I have this Kotlin object which parses an XML into a
data class
:And this Java test:
Parsing this in Jackson 2.12.0 fails with
com.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot construct instance of jackson.xml.XmlTool$Stuff (although at least one Creator exists): no default no-arguments constructor found
.Jackson 2.11.3 works just fine.
The full exception is:
Here's a test project: https://github.com/henrik242/jackson-xml-problem/tree/2-12-empty-constructor
The text was updated successfully, but these errors were encountered: