Skip to content
← All insights

Engineering

Notes from a Spring Boot 4 and Java 21 migration

The breaking changes that actually cost us time — Jackson 3, Redis serializers, JWT configuration and native images — and how we handled them.

Techindeck Ventures ·

Upgrading a multi-module Spring Boot platform to version 4 on Java 21 is mostly smooth — until a handful of changes ripple through every module. These are the ones worth planning for.

Jackson 2 → 3 package renames

Jackson 3 moves from com.fasterxml.jackson to tools.jackson for most packages. Any custom serializer, ObjectMapper configuration or mix-in breaks at compile time. Do the rename in one sweep across all modules, then fix the few APIs whose method names changed.

Redis serializer deprecations

The JSON serializers for Spring Data Redis follow the Jackson change. Replace deprecated serializers with the current equivalents and re-check anything cached as JSON — old cache entries may not deserialize, so plan a cache flush during the release.

JWT resource server configuration

With Keycloak issuing tokens, an explicit NimbusJwtDecoder built from the issuer’s JWK set URI keeps configuration predictable across environments. Map realm roles to authorities in one converter shared by the gateway and services.

GraalVM native images

Native images give near-instant start-up and lower memory on EC2 — useful with spot instances and auto scaling. Expect to add reflection hints for libraries that build objects dynamically, and test the native build in CI, not just the JVM build.

A checklist that helped

  • Upgrade the build plugins and parent POM first, then modules one by one
  • Run the full test suite on the JVM before attempting native builds
  • Flush caches and roll out behind a feature flag where possible
  • Keep the previous release ready for a quick rollback

Planning an upgrade? We are happy to review your codebase and estimate the effort.

Your idea.
Our engineering.

Tell us what you want to build. Within one working day, you’ll have a clear next step.