Scrivio Interview library
ConceptFoundations7 min read · updated 12 November 2026

List the main changes you must handle when upgrading a service from Spring Boot 2.7 to 3.x.

Spring Boot 3 needs Java 17 and moves from Java EE to Jakarta EE, so every javax.persistence, javax.servlet and javax.validation import becomes jakarta. It is built on Spring Framework 6 and Spring Security 6, where WebSecurityConfigurerAdapter is gone and security is configured with a SecurityFilterChain bean. Some properties were renamed, such as spring.redis.* to spring.data.redis.*, trailing slash matching is off by default in MVC, Hibernate moves to version 6, and Micrometer Tracing replaces Spring Cloud Sleuth.

Why this question is asked

Boot 3 was the largest Spring Boot release in years, and many services still carry code written for 2.x. Even teams that have migrated meet the same changes again when they review old code or upgrade a library that skipped a version. Interviewers ask for the list to check that we know not only the headline items, Java 17 and Jakarta, but also the quieter changes that break behaviour without breaking compilation. In this answer, we will go through the platform baseline, the Jakarta package move, the Spring Security changes, renamed properties, trailing slash matching, Hibernate 6, and the move from Sleuth to Micrometer Tracing, with the before and after for each.

1A New Baseline: Java 17 and Spring Framework 6

Spring Boot 3.0 requires Java 17 or later, because Spring Framework 6 is compiled for it and uses its language features internally. A service still running on Java 8 or 11 has to move its build, its CI images and its runtime images to Java 17 or later before it can upgrade Boot. Today we would usually go straight to Java 21 or 25, both long-term support releases.

Spring Framework 6 is the foundation for everything else in this list. It is where the Jakarta move, the URL matching change and the removal of long-deprecated APIs come from, and every Spring project, such as Spring Data, Spring Security and Spring Cloud, released matching new generations at the same time.

Main changes from Spring Boot 2.7 to 3.x
AreaBoot 2.7Boot 3.x
Java8 or later17 or later
Enterprise APIsjavax.*jakarta.*
Security configWebSecurityConfigurerAdapterSecurityFilterChain @Bean
Redis propertiesspring.redis.*spring.data.redis.*
Trailing slash/orders/ matches /ordersno match, 404
JPA providerHibernate 5.6Hibernate 6
TracingSpring Cloud SleuthMicrometer Tracing
The headline items break compilation; the quiet ones change behaviour.

2From javax to jakarta

Java EE, the set of enterprise APIs such as JPA, Servlet and Bean Validation, was handed to the Eclipse Foundation and renamed Jakarta EE. From Jakarta EE 9, the packages were renamed from javax to jakarta. Boot 3 uses Jakarta EE 10 APIs, so every import of those APIs must change.

Notice that only the enterprise APIs moved. Packages that belong to the JDK itself, such as javax.sql.DataSource or javax.crypto, stay as they are, which is why a blind search-and-replace of javax with jakarta breaks the build.

Java
// Boot 2.7
import javax.persistence.Entity;
import javax.servlet.http.HttpServletRequest;
import javax.validation.constraints.NotBlank;
import javax.sql.DataSource; // JDK: unchanged
// Boot 3.x
import jakarta.persistence.Entity;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.validation.constraints.NotBlank;
import javax.sql.DataSource; // still javax

Third-party libraries must move too. Any library that uses servlet filters, JPA or validation needs a Jakarta-compatible version, and some old libraries never got one; Springfox, for example, was replaced by springdoc-openapi 2 in most projects.

3Spring Security 6: No More WebSecurityConfigurerAdapter

In Spring Security 5, we configured web security by extending WebSecurityConfigurerAdapter and overriding configure(HttpSecurity). That class was deprecated in 5.7 and removed in 6. Instead, we declare a SecurityFilterChain bean, a bean that holds the ordered list of security filters for a set of requests. Along with it, authorizeRequests became authorizeHttpRequests, antMatchers and mvcMatchers were replaced by requestMatchers, and @EnableGlobalMethodSecurity became @EnableMethodSecurity.

Java
// Boot 2.7: no longer compiles on Boot 3
@Configuration
class SecurityConfig extends WebSecurityConfigurerAdapter {
@Override
protected void configure(HttpSecurity http) throws Exception {
http.authorizeRequests()
.antMatchers("/actuator/health").permitAll()
.anyRequest().authenticated();
}
}
// Boot 3.x
@Configuration
class SecurityConfig {
@Bean
SecurityFilterChain api(HttpSecurity http) throws Exception {
http.authorizeHttpRequests(auth -> auth
.requestMatchers("/actuator/health").permitAll()
.anyRequest().authenticated());
return http.build();
}
}

The new style was already available in 2.7, so we can make this change before upgrading, which is the safer order.

4Renamed Properties

Some configuration properties were moved to more consistent names. The best-known is Redis: spring.redis.host and its siblings became spring.data.redis.host, because Redis support belongs to Spring Data. Cassandra went the other way, from spring.data.cassandra.* to spring.cassandra.*. Metrics export properties moved from management.metrics.export.<system>.* to management.<system>.metrics.export.*, for example management.prometheus.metrics.export.enabled.

The danger is that an old property name does not cause an error. Boot simply ignores it, so a service quietly connects to localhost:6379 instead of the configured Redis. The spring-boot-properties-migrator module, added as a runtime dependency during the upgrade, reports renamed properties at start-up and maps them temporarily.

Properties
# Boot 2.7
spring.redis.host=cache.internal
# On Boot 3.x without fixing it: ignored, Redis client connects to localhost:6379
# With spring-boot-properties-migrator on the classpath, the log shows something like:
# Property source 'application.properties':
# Key: spring.redis.host
# Replacement: spring.data.redis.host
# Boot 3.x
spring.data.redis.host=cache.internal

5Trailing Slash Matching Is Off

In Spring MVC before Framework 6, a mapping for /orders also matched /orders/ with a trailing slash. Framework 6 disabled this by default, because two URLs mapping to the same handler can confuse security rules and caches. After the upgrade, clients that call /orders/ get a 404. This change compiles fine and passes tests that use the exact paths, so it often surfaces only in production.

Java
@GetMapping("/orders")
List<Order> list() { ... }
// Boot 2.7: GET /orders -> 200, GET /orders/ -> 200
// Boot 3.x: GET /orders -> 200, GET /orders/ -> 404

The right fix is to update clients to the canonical path. If that is not possible quickly, a redirect or rewrite filter, or an explicit second mapping, can bridge the gap; the old setTrailingSlashMatch option exists only as a deprecated transition aid, so check your version.

6Hibernate 6 and Micrometer Tracing

Boot 3 uses Hibernate 6, whose artifact moved to the org.hibernate.orm group. Hibernate 6 rewrote its query engine and changed several defaults, so some HQL and native queries behave differently, and ID generation changed: with GenerationType.AUTO or SEQUENCE and no explicit generator, Hibernate now expects a sequence per entity, named like orders_seq with an increment of 50, rather than one shared hibernate_sequence. A schema migrated for 2.7 may need new sequences, or an explicit generator configuration, before inserts work.

Spring Cloud Sleuth, which added trace and span ids to logs and propagated them between services, is not supported on Boot 3. Its job moved into Micrometer Tracing, with a bridge to OpenTelemetry or Brave, configured through management.tracing.* properties. The sampling probability defaults to 0.1, so only 10 percent of requests are traced unless we change it, which surprises teams who expect every request to appear in their tracing tool.

Properties
# Boot 3.x tracing setup
# dependencies: micrometer-tracing-bridge-otel, opentelemetry-exporter-otlp
management.tracing.sampling.probability=1.0 # default 0.1 -> only 10% of requests traced
# Log lines then carry traceId and spanId via the logging pattern or structured logging

Two smaller changes are worth mentioning. Auto-configuration classes must be registered in META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports instead of spring.factories, which matters for internal starters, and the default log date format changed to ISO-8601.

7Follow-up questions

Why does a search-and-replace of javax to jakarta break the build?

Because only the Java EE APIs moved to jakarta. Packages that are part of the JDK, such as javax.sql, javax.crypto, javax.net and javax.annotation.processing, stay javax. Migration tools such as OpenRewrite's Jakarta recipes know exactly which packages to change, which is why they are safer than text replacement.

Which of these changes do not show up as compile errors?

Renamed properties, which are silently ignored, trailing slash matching, which turns into 404s, Hibernate's sequence and query changes, which fail at runtime, and the tracing sampling default. These are the reasons to run the properties migrator, run thorough integration tests and compare behaviour in staging before production.

Do Spring Cloud versions need to change too?

Yes. Each Spring Cloud release train supports specific Boot versions; Boot 3.0 needs Spring Cloud 2022.0 or later. The Spring Cloud compatibility table on the project page shows which train matches which Boot version.

8Conclusion

In this answer, we went through the main changes from Spring Boot 2.7 to 3.x. Java 17 is the new baseline, enterprise APIs moved from javax to jakarta, Spring Security 6 replaced WebSecurityConfigurerAdapter with a SecurityFilterChain bean, properties such as spring.redis.* moved to spring.data.redis.*, trailing slash matching is off by default in MVC, Hibernate 6 changes queries and ID sequences, and Micrometer Tracing replaces Spring Cloud Sleuth. Several of these change behaviour without failing compilation, so tests and the properties migrator matter as much as fixing compile errors.

What to say in the interviewAbout 70 seconds aloud

Open with

The first two are the big ones: Boot 3 needs Java 17, and it moves to Jakarta EE, so javax.persistence, javax.servlet and javax.validation imports become jakarta, while JDK packages like javax.sql stay, and every library that touches those APIs needs a Jakarta version; Springfox, for example, gets replaced with springdoc 2.

Then, if they want more

It is built on Spring Framework 6 and Spring Security 6, where WebSecurityConfigurerAdapter is removed, so security becomes a SecurityFilterChain bean with authorizeHttpRequests and requestMatchers; I would do that change on 2.7 already, since the new style works there. Then the quieter changes, which do not break compilation.

Some properties were renamed, like spring.redis to spring.data.redis, and old names are silently ignored, so I add the properties migrator during the upgrade. Trailing slash matching is off, so /orders/ now returns 404. Hibernate 6 changes queries and expects per-entity sequences with an increment of 50 for generated IDs.

And Sleuth is replaced by Micrometer Tracing with the OpenTelemetry or Brave bridge, where sampling defaults to ten percent. Also auto-configurations register through the AutoConfiguration.imports file, and the Spring Cloud train must move to 2022.0 or later.

About this answer

Last updated
12 November 2026
Versions it names
Java 17, Hibernate 6, Spring Framework 6, Spring Security 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.
Official documentation
Spring Boot reference
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 "List the main changes you must handle when upgrading a service from Spring Boot 2.7 to...": https://scrivio-interview-library.netlify.app/spring-boot/boot-migrations/34fae65da3/