Scrivio Interview library
ScenarioIntermediate6 min read · updated 12 November 2026

Plan the upgrade of one service from Spring Framework 5.3 to 6.2. What steps would you take and what typically breaks?

I would first move to the latest 5.3.x and remove deprecation warnings, then move to Java 17, then switch to Spring 6 with Jakarta EE packages and Jakarta-compatible versions of every dependency, and only then step through 6.0, 6.1 and 6.2 with each release's notes. Typical breakages are the javax to jakarta rename, trailing slash matching being disabled by default, removed deprecated APIs, and, since 6.1, parameter names that resolve only when the code is compiled with -parameters because LocalVariableTableParameterNameDiscoverer was removed. OpenRewrite recipes automate much of the mechanical work, and the test suite catches behaviour changes.

Why this question is asked

Moving from Spring Framework 5.3 to 6.2 is not a version bump. It crosses a Java baseline change, a package rename that affects nearly every web and persistence class, and three minor releases of behaviour changes. Teams that treat it as one big jump often spend weeks with a broken build and no idea which change caused which failure. Interviewers ask this scenario to see whether we break the upgrade into safe steps and know the classic traps. In this answer, we will plan the order of the steps, go through the Java and Jakarta move, look at what typically breaks with examples, deal with the -parameters change, and see how tooling and tests keep it under control.

1Planning the Order of the Steps

The guiding idea is to change one thing at a time, so that every failure has a single cause. First we upgrade to the latest 5.3.x release and turn on deprecation warnings, because anything deprecated in 5.3 is a candidate for removal in 6. Fixing those warnings while still on 5.3 is safe, since the old code still works and our tests run normally.

Then we move the build and runtime to Java 17, still on Spring 5.3, which supports it. After that comes the big step, Spring 6.0 with Jakarta EE, followed by 6.1 and 6.2, each with its own pass through the release notes.

Step throughUpgrade path from 5.3 to 6.2
  1. Upgrade to the latest 5.3.xfix deprecation warnings
  2. Move to Java 17still on Spring 5.3, tests green
  3. Upgrade dependencies to Jakarta versionsTomcat 10.1, Hibernate 6, Validator 8
  4. Switch to Spring 6.0 and jakarta.* importsOpenRewrite for the rename
  5. Fix 6.0 behaviour changestrailing slash, path patterns, removed APIs
  6. Upgrade to 6.1-parameters, other 6.1 notes
  7. Upgrade to 6.2read its upgrade notes, run tests
  8. Deploy to a canary and watch errorscompare 404s, latency and logs

8 steps in order. Play them, or step through them one at a time.

2Java 17 and the Jakarta Move

Spring Framework 6 requires Java 17 and Jakarta EE 9 or later. Jakarta EE is the continuation of Java EE under the Eclipse Foundation, and when it moved, the package names changed from javax.* to jakarta.*. So javax.servlet.http.HttpServletRequest becomes jakarta.servlet.http.HttpServletRequest, javax.persistence.Entity becomes jakarta.persistence.Entity, and javax.validation becomes jakarta.validation.

The rename is not only in our code. Every library that touches those APIs must be on a Jakarta version too: the servlet container (Tomcat 10.1, Jetty 12), Hibernate ORM 6, Hibernate Validator 8, and any filters or security libraries. A single library still compiled against javax.servlet will fail at runtime with a NoClassDefFoundError or ClassNotFoundException, so we check the dependency tree before switching.

Java
// Before (Spring 5.3)
import javax.persistence.Entity;
import javax.servlet.http.HttpServletRequest;
// After (Spring 6.x)
import jakarta.persistence.Entity;
import jakarta.servlet.http.HttpServletRequest;
// An old library left on javax at runtime:
// java.lang.NoClassDefFoundError: javax/servlet/Filter

Note that some javax packages are part of the JDK and do not change, such as javax.sql.DataSource and javax.crypto. Only the Java EE APIs moved, which is why an automated rename tool is safer than a global search and replace.

3What Typically Breaks in 6.0

Beyond the rename, 6.0 changed several defaults. The best known is trailing slash matching: in 5.3, a mapping for /users also matched /users/, and in 6.0 it no longer does, so clients that call /users/ start receiving 404. Spring MVC also uses PathPatternParser by default, which rejects some patterns AntPathMatcher accepted, such as ** in the middle of a path. And long-deprecated APIs were removed, including the HTTP remoting support, CommonsMultipartResolver, AsyncRestTemplate and several old integrations.

Common breakages when moving to 6.x
ChangeSymptomFix
javax to jakartacompile errors, NoClassDefFoundErrorrename imports, Jakarta versions of libraries
Trailing slash not matched (6.0)404 for /users/fix clients, or redirect in a filter
PathPatternParser default (6.0)startup error for /**/x patternsrewrite patterns
Removed deprecated APIs (6.0)compile errorsreplace, e.g. StandardServletMultipartResolver
-parameters required (6.1)name not available for argumentcompile with -parameters or name it
6.2 behaviour refinementstest failures in edge casesread the 6.2 upgrade notes

4The -parameters Change in 6.1

Spring often needs the names of method parameters, for example for @PathVariable Long id without an explicit name, @RequestParam, constructor binding, or a SpEL expression like #id in a @Cacheable key. Before 6.1, Spring could read names from debug information through LocalVariableTableParameterNameDiscoverer. That class was removed in 6.1, so names are now only available when the code is compiled with the javac -parameters flag.

Java
@GetMapping("/users/{id}")
User get(@PathVariable Long id) { ... }
// Compiled without -parameters, on 6.1+:
// IllegalArgumentException: Name for argument of type [java.lang.Long] not specified,
// and parameter name information not available via reflection. Ensure that the compiler uses the '-parameters' flag.
// Fix 1: compile with -parameters (Maven: <maven.compiler.parameters>true</maven.compiler.parameters>)
// Fix 2: name it explicitly
User get(@PathVariable("id") Long id) { ... }

Spring Boot's build plugins set -parameters for us, which is why plain Spring applications built with custom Maven or Gradle settings hit this more often. The exact exception text may differ slightly by version.

5Letting Tools and Tests Do the Work

OpenRewrite, a refactoring tool that applies recipes to source code, has recipes for the Java 17 move, the javax to jakarta migration and Spring upgrades; check the current recipe names in its catalogue. It handles the mechanical parts, imports, renamed classes and many removed APIs, in minutes and in a reviewable diff.

Behaviour changes are a different matter: no tool can tell us that a client calls /users/ with a slash. That is what tests are for, especially web tests that call real URLs, and a canary deployment where we compare 404 rates, errors and latency with the old version before rolling out fully.

6Follow-up questions

Why should you go 6.0, 6.1, 6.2 in steps or read each release note?

Because each minor release has its own behaviour changes and removals, and the upgrade notes are written per release. Jumping straight to 6.2 means meeting the 6.0, 6.1 and 6.2 changes at once, so a failing test could be caused by any of them. Moving one minor at a time, or at least reading each release's notes in order and fixing their items, keeps each failure tied to one documented change.

Can we upgrade Spring Framework without Spring Boot?

If the service uses Spring Boot, the Framework version comes with Boot, so moving to Framework 6 means moving to Boot 3, which adds Spring Security 6 configuration changes and Boot property changes on top. For a plain Spring application, we upgrade the Framework BOM directly and manage the other dependencies ourselves.

How do you find libraries still using javax?

Inspect the dependency tree for known Java EE artifacts, such as javax.servlet-api or javax.persistence-api, and search the resolved jars for javax/servlet or javax/persistence classes. Tools such as the Maven dependency plugin or Gradle dependencyInsight show which dependency brings them in, so we can upgrade or replace it.

7Conclusion

In this answer, we planned the 5.3 to 6.2 upgrade as a series of single-cause steps: latest 5.3 with deprecations fixed, Java 17, Jakarta versions of dependencies, the switch to 6.0 with the jakarta rename, and then 6.1 and 6.2 with their notes. We saw the typical breakages, the javax rename, trailing slash matching, stricter path patterns, removed APIs and the -parameters requirement since 6.1, and used OpenRewrite for mechanical changes and tests plus a canary for behaviour changes.

What to say in the interviewAbout 80 seconds aloud

Open with

I would split it into steps with one cause each. First, upgrade to the latest 5.3 release and fix every deprecation warning, because deprecated APIs are what 6.0 removed, and we can fix them while everything still works.

Then, if they want more

Second, move to Java 17 while still on 5.3. Third, move dependencies to their Jakarta versions, like Tomcat 10.1, Hibernate 6 and Hibernate Validator 8, and switch to Spring 6.0, renaming javax imports to jakarta. I would use OpenRewrite recipes for that rename rather than search and replace, since packages like javax.sql stay as they are.

Then I fix the 6.0 behaviour changes. The classic ones are trailing slash matching being disabled by default, so /users/ returns 404, PathPatternParser rejecting some old patterns, and removed APIs like CommonsMultipartResolver and HTTP remoting.

Then 6.1, where LocalVariableTableParameterNameDiscoverer was removed, so parameter names for things like @PathVariable without a name only work if we compile with -parameters, which Boot's plugins do but custom builds often do not. Then 6.2, reading its upgrade notes.

At each step, the test suite, especially web tests against real URLs, catches behaviour changes, and I would finish with a canary comparing 404 and error rates against the old version.

About this answer

Last updated
12 November 2026
Versions it names
Java 17, Jakarta EE 9, Spring Framework 5, Spring Framework 6
Checked
Its structure and format are checked automatically. Use it as a carefully prepared study note: where a detail matters, confirm it against the documentation below. What the checks cover
Where the question comes from
Written by Scrivio for practice. It is not taken from an interview.
Report an issue with this answer

Copy the line below and send it to the author with what you found. It carries the address of this page.

Issue with "Plan the upgrade of one service from Spring Framework 5.3 to 6.2. What steps would you...": https://scrivio-interview-library.netlify.app/spring-boot/spring-framework-evolution/4f88055287/