r/SpringBoot • u/fkfdkdiddi • Mar 01 '26
Discussion Migration to Spring Boot 4.x: What are the hidden pitfalls you've encountered?
Tell me what broke so I don't make the same mistakes 👀
65
Upvotes
36
u/szhrmp Mar 01 '26
Migration to jackson 3 changes how null values for primitives are handled - causes some work for us
13
u/boost2525 Mar 01 '26
The upgrade from the 3.x line was painless. A few deprecated methods that we migrated from now instead of later but no breaking changes.
The move from Jackson2 to Jackson 3 was more cumbersome though. No breaking changes, just headaches to track down every use of Jackson 2 and remove it, since spring 4 supports both.
2
u/yakahaw Oct 10 '26
Two things that bit me that aren't obvious from the release notes. First, autoconfig is now split per technology: if you only have
flyway-core, Flyway silently stops running. You needspring-boot-flyway, and nothing logs its absence, the app boots fine on an already-migrated schema. Second, Jackson 3 flippedFAIL_ON_NULL_FOR_PRIMITIVESto true, so any request record with a primitive field the client omits now returns a 400 with no field name. Set it back to false if you have older clients in the wild.11
u/TheVoidInMe Mar 01 '26
Swagger doesn’t yet support Jackson 3 (issue), so that’s pretty much a hard blocker for us
8
u/auspis-23 Mar 01 '26
Jackson 3: if you opt to postpone the migration and decide to stay on version 2 with spring boot 4 you can have some serialization issue because of different order of some filters.
12
u/Key_Equivalent_4359 Mar 01 '26
fucking Jackson
6
u/kspr2024 Mar 02 '26
If you are using AI, this Spring Boot 3 to 4 Migration skills is very helpful.
https://github.com/adityamparikh/spring-boot-4-migration-skill
5
u/RevolutionaryRush717 Mar 01 '26
Retry is now out of the box, but lost the possibility of a listener configured in the annotation.
That might be fixed in a minor release though.
As was discussed somewhere, the configuration changelog can be handy, e.g., for MongoDB users.
4
u/hellfire51 Mar 01 '26
Spring Security changed to using RestClient in most of its OAuth stuff making it not respect proxy configuration. I don't quite understand how anyone is using it behind a proxy.
3
u/Responsible_Gap337 Mar 01 '26
We have just started migration from Jersey to Spring MVC due to this upgrade. :(
3
u/veryspicypickle Mar 01 '26
Jackson. Biggest pitfall of them all.
2
u/Samsagax Mar 01 '26
Migration to Jackson 3 is a pain right now specially if you use Lombok.
Either use the legacy Jackson 2 artifacts or bleeding edge Lombok.
2
u/Avensi Mar 02 '26
Jackson 3 mostly. Super painful if you use stuff like JsonNode and feign, some method also changed their nullabillity so beware. Also breaks Mockito but it's much easier to repair
2
u/kedarjoshi Mar 02 '26
Upgrade to Hazelcast 5.6 is blocked because of https://github.com/hazelcast/hazelcast/issues/26546.
3
u/roiroi1010 Mar 01 '26
I just migrated to Spring Boot 3 😅
I’ll hold off for a bit
1
u/daqueenb4u Mar 02 '26
JUnit changes, specifically moving from 4 to jupiter and changes in the test annotations. Ughh!
1
u/Finchey86 Mar 23 '26
Probably not an issue for most of you guys but there is no longer support for Reactive Kafka as the Project Reactor will discontinue Reactor Kafka. There is no alternative provided so you are on your own.
https://spring.io/blog/2025/05/20/reactor-kafka-discontinued