fix: detect incompatible Jackson version at startup#24009
fix: detect incompatible Jackson version at startup#24009
Conversation
Vaadin requires Jackson 3.1+ but Spring Boot 4.0.3 and earlier ship Jackson 3.0 which has incompatible API changes. This caused a cryptic NoSuchMethodError at runtime. Adding an early check in VaadinService.init() surfaces a clear error message with remediation steps instead.
flow-server/src/main/java/com/vaadin/flow/internal/JacksonUtils.java
Outdated
Show resolved
Hide resolved
| "The Jackson version on the classpath (" + jacksonVersion | ||
| + ") is not compatible with this version of Vaadin." | ||
| + " This version of Vaadin requires Jackson 3.1+." | ||
| + " Please upgrade your Jackson dependencies." | ||
| + " Note that Spring Boot 4.0.3 and earlier include" | ||
| + " Jackson 3.0; upgrading to Spring Boot 4.0.4 or" | ||
| + " later resolves this.", |
There was a problem hiding this comment.
One more though about the message. Basically, we are telling users to update Jackson to 3.1.
However, it might be the case that the project is using Jackson 2 and there is actually no need to migrate to 3.1. The fix is to bump to a Jackson 2 version with a compatible jackson-annotation dependency.
For example, Quarkus does not support Jackson 3, but it depends on the latest Jackson 2 version, compatible Jackson 3.1
There was a problem hiding this comment.
Another potential example is JEE containers like Wildfly, that might ship an older Jackson version that leaks into the application classpath.
In the release notes we already have some hints on how to deal with this, but the proposed message could be misleading.
There was a problem hiding this comment.
Would this new version work better?
There was a problem hiding this comment.
I'm a bit picky. but the issue is not only about having Jackson 3.0 instead of 3.1.
The problem can still happen if the project uses Jackson 2.19 for its own purposes. This might also cause failures, depending on how transitive dependencies are resolved. In that case the fix would be to bump Jackson 2 to 2.21.x.
We should maybe also add something like: "If you have Jackson 2, update it to version 2.21 or later"
|



Vaadin requires Jackson 3.1+ but Spring Boot 4.0.3 and earlier ship Jackson 3.0 which has incompatible API changes. This caused a cryptic NoSuchMethodError at runtime. Adding an early check in VaadinService.init() surfaces a clear error message with remediation steps instead.