FasterXML / jackson-dataformat-xml

Extension for Jackson JSON processor that adds support for serializing POJOs as XML (and deserializing from XML) as an alternative to JSON
Apache License 2.0
567 stars 221 forks source link

XmlMapper instantiation fails on branch 2.16 due to databind #4101 #607

Closed k163377 closed 1 year ago

k163377 commented 1 year ago

This is a transcription of an issue reported on the jackson-dev mailing list.


The cause is that the following PR added a null check for cache. https://github.com/FasterXML/jackson-databind/pull/4101/files#diff-25c6303c76a7f05a72cdc35a1271bcc9374db3745d61ab895e7199f050619f7eR168

XmlMapper passes null to the cache, which causes an error. https://github.com/FasterXML/jackson-dataformat-xml/blame/d1766c9fc014d95b99657b00a0b52e610bd75004/src/main/java/com/fasterxml/jackson/dataformat/xml/deser/XmlDeserializationContext.java#L34

cowtowncoder commented 1 year ago

Thank for reporting this -- I will see if I can reproduce the problem.

cowtowncoder commented 1 year ago

Yes, actually have a compilation incompatibility too. Will resolve.

cowtowncoder commented 1 year ago

Note: this does mean that jackson-dataformat-xml and jackson-databind both need to be 2.16; there is somewhat close coupling due to requirements to keep DefaultDeserializationContext compatible (wrt new withCaches(CacheProvider)), not way around that. It does not change Jackson project's official stance anyway (all Jackson components SHOULD have same minor version; no other guarantees given), but is against ideal case (wherein "adjacent" minor versions in dependency direction SHOULD work -- xml-format 2.15 should work with databind 2.16 -- but that is not maintained here, due to it not being possible, basically).

JooHyukKim commented 1 year ago

PR mentioned above : https://github.com/FasterXML/jackson-databind/pull/4101

Just connecting things for easier follow.