Jackson-databind version conflict #138
-
|
I have an application with spring boot version 3.2.2 and Java 17 version. I tried to use the JToon library method JToon.encodeJson(json) in one of my services. But it always gives me back Handler dispatch failed: java.lang.NoClassDefFoundError: When I debugged the code. I noticed the code jsonNormalize.parse() in JToon class is where the problem occurs. Help me what to change and what version should I use in my project |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
|
JToon uses Jackson 3, that is used in Spring Boot 4. If you can't migrate to Spring Boot 4 (what is highly recommended), change your Gradle / Maven config in order to use Jackson 2 and 3 in the same application: FasterXML/jackson-future-ideas#90 The link above may help you, but I repeat: if you can, migrate your application to Spring Boot 4.: https://blog.felipestanzani.com/2026/01/16/spring-boot-4-brief-upgrade-guide-and-code-comparison/ |
Beta Was this translation helpful? Give feedback.
-
|
A concrete way to confirm this is to inspect the resolved Jackson artifacts, not only the dependencies you declared: mvn dependency:tree -Dincludes=com.fasterxml.jackson.core:jackson-annotations,tools.jackson.core,tools.jackson.module,dev.toonformat:jtoon
Spring Boot 3.2.2 manages the older Jackson 2 line. If Boot dependency management forces So I would do one of these:
In short: this is not a normal Spring Boot 3.2 + Jackson 2 mismatch. It is Boot 3.2's Jackson 2 dependency management colliding with a library that already uses Jackson 3. |
Beta Was this translation helpful? Give feedback.
A concrete way to confirm this is to inspect the resolved Jackson artifacts, not only the dependencies you declared:
JToonis on Jackson 3 (tools.jackson.*). For example, the currentdev.toonformat:jtoon:2.0.0POM pullstools.jackson.core:jackson-databind:3.1.3, whose BOM expectscom.fasterxml.jackson.core:jackson-annotations:2.21.Spring Boot 3.2.2 manages the older Jackson 2 line. If Boot dependency management forces
jackson-annotationsback to2.15.x, Jackson 3 databind can start but then fail at runtime with: