Repository navigation
Conversation
With databind 2.22.3 as the only Jackson dependency, Maven's nearest-first resolution took jackson-core and jackson-annotations from any other Jackson module an application declares, since databind's own sit one level deeper. A project declaring logback-logtail and then jackson-datatype-jsr310 2.13.5 (for the JavaTimeModule the examples register) but not databind got databind 2.22.3 with core and annotations 2.13.5: logback could not create the appender (NoClassDefFoundError: JsonSerializeAs) and no logs were sent. With jackson-datatype-jdk8 2.13.5 instead, the appender was created and every flush died with NoSuchMethodError in BufferRecycler. Declaring core 2.22.3 and annotations 2.22, the versions databind 2.22.3 depends on, puts them as near as any other module's. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Member
Author
|
Closing: keeping #40's POM with jackson-databind only (the usual pattern, e.g. logstash-logback-encoder); Jackson alignment (jackson-bom) goes into the 0.4.0 release notes and docs instead. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #40. With
jackson-databind2.22.3 as the only Jackson dependency, Maven's nearest-first resolution takesjackson-coreandjackson-annotationsfrom any other Jackson module the application declares, because databind's own sit one level deeper. A project that declareslogback-logtailand thenjackson-datatype-jsr3102.13.5 (for<objectMapperModule>com.fasterxml.jackson.datatype.jsr310.JavaTimeModule</objectMapperModule>, which the examples use) but notjackson-databindgot databind 2.22.3 with core and annotations 2.13.5: logback printed "Could not create an Appender of type [com.logtail.logback.LogtailAppender]" (NoClassDefFoundError: com/fasterxml/jackson/annotation/JsonSerializeAs), the application kept running and nothing was sent. Withjackson-datatype-jdk82.13.5 instead, the appender was created and every flush died withNoSuchMethodError: BufferRecycler.releaseToPool(). With 0.3.8 and 0.3.9 (databind 2.13.5) the jsr310 project sends everything.jackson-core2.22.3 andjackson-annotations2.22, the versions databind 2.22.3 depends on, are now declared next to it. They are as near as any other module's and win whenlogback-logtailis declared first. Only the POM changes; the class files are identical.jackson-databinditself afterlogback-logtail, as the docs' dependency block does with 2.13.5, now gets core and annotations 2.22 under its databind instead of matching versions. Jackson keeps core and annotations backward compatible: with databind 2.12.7, 2.13.5 and 2.17.3 on core 2.22.3 the example app sends everything, and a check of the application's own Jackson use (data binding, trees,convertValue, streaming,java.time) passes. Core 2.22 does bring its default processing limits to that application's own parsing (nesting depth 1000, numbers up to 1000 digits, strings up to 20M characters), which core 2.13.5 did not have. Declaring databind beforelogback-logtail, or importingjackson-bom, keeps matching versions.jackson-coreitself but not databind keeps its core, since a direct declaration always wins, so databind 2.22.3 runs on core 2.13.5 and every flush fails (0.3.9 resolved matching 2.13.5 there). Only the application can fix that, by declaring databind at the same version or importingjackson-bom.jackson-bomplatform in databind's Gradle module metadata: both Gradle projects below resolved 2.22.x, before and after.Measured with the example app (7 lines, plain
java -cpon JDK 21) against a Better Stack source, rows queried back.logback-logtail0.4.0 = main + #40, without and with this change; versions are databind / core / annotations:To land it: merge this into #40's branch before squash-merging #40, or retarget it to
mainonce #40 is merged.🤖 Generated with Claude Code