Why Spring Boot 4.0 Dropped Support for Undertow

Spring Boot 4.0 removes Undertow because it cannot meet the Servlet 6.1 baseline, leading to build failures for projects that depend on spring-boot-starter-undertow, and the article analyzes the technical reasons, compatibility matrix, and lessons for future web‑container selection.

JavaGuide
JavaGuide
JavaGuide
Why Spring Boot 4.0 Dropped Support for Undertow

Spring Boot 4.0 RC1 – removal of Undertow support

When a project declares

<dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-undertow</artifactId></dependency>

, the build fails because Spring Boot 4.0 no longer provides Undertow auto‑configuration or dependency management.

“Spring Boot 4.0 needs a Servlet 6.1 baseline, and Undertow is not yet compatible. Therefore we dropped support for Undertow.”

The root cause is a version‑dependency mismatch: Spring Boot 4.0 targets Servlet 6.1, while Undertow 2.3.x does not implement Servlet 6.1. The Spring team tracks the change in GitHub Issue #46917.

Undertow maintainers (Red Hat) have started work on Servlet 6.1 support, but as of October 2025 the effort remains in early stages, limiting upgrade options for enterprises.

Servlet 6.1 technical features

Release background

Servlet 6.1 was released in April 2024 as the core sub‑specification of Jakarta EE 11.

Key new features

ByteBuffer support added to ServletInputStream and ServletOutputStream for non‑blocking I/O.

// Read request data with a ByteBuffer
ByteBuffer buffer = ByteBuffer.allocate(1024);
servletInputStream.read(buffer);

HTTP/2 Server Push deprecated , reflecting its declining usage.

Removal of SecurityManager APIs , eliminating references to the deprecated Java SecurityManager.

HTTP session enhancement allowing interaction with sessions outside the standard request flow, useful for WebSocket scenarios.

HTTP redirect control enhancement giving fine‑grained control over status code and response body.

// Custom redirect response
response.setStatus(HttpServletResponse.SC_MOVED_PERMANENTLY);
response.setHeader("Location", newUrl);
response.getWriter().write("Resource has moved");

Sensitive request header handling via new HttpServlet.isSensitiveHeader method, which excludes headers such as Authorization, Cookie, and Forwarded from TRACE responses.

Conditional GET optimization through improved getLastModified support, reducing unnecessary data transfer.

Jakarta EE 11 and Jakarta Data

Jakarta EE 11 adopts Servlet 6.1 as its core sub‑specification, representing the latest enterprise Java platform.

Jakarta Data core features

BasicRepository provides out‑of‑the‑box CRUD methods.

public interface ProductRepository extends BasicRepository<Product, Long> {
    // save(), findById(), findAll(), delete()
}

CrudRepository extends BasicRepository with full CRUD and query method support.

public interface UserRepository extends CrudRepository<User, String> {
    List<User> findByEmailContaining(String email);
    Page<User> findByStatus(UserStatus status, PageRequest page);
}

Pagination supports both offset‑based and cursor‑based approaches.

// Offset‑based
Page<Product> findByCategory(String category, PageRequest pageRequest);

// Cursor‑based (better for large data sets)
CursoredPage<Product> findByPriceGreaterThan(BigDecimal price, PageRequest pageRequest);

Query language simplifies method‑level queries.

public interface OrderRepository extends CrudRepository<Order, Long> {
    @Query("SELECT o FROM Order o WHERE o.status = ?1 AND o.total > ?2")
    List<Order> findHighValueOrders(OrderStatus status, BigDecimal minTotal);
}

Web container support matrix for Servlet 6.1 / Jakarta EE 11

Spring Framework 7.x – full support for both Servlet 6.1 and Jakarta EE 11.

Spring Boot 4.x – full support for both.

Tomcat 11.x+ – full support for both.

Jetty 12.1+ – full support for both.

Undertow 2.3.x – does not support Servlet 6.1 nor Jakarta EE 11.

The matrix shows Undertow as the only major container lacking Servlet 6.1 support, which is the fundamental reason Spring Boot 4.0 removed its Undertow starter.

Implications

Enterprises upgrading to Spring Boot 4.0 must migrate away from Undertow to a container that implements Servlet 6.1 (e.g., Tomcat or Jetty). The case illustrates that technology selection should consider long‑term ecosystem evolution in addition to current performance characteristics.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

spring-bootundertowbackend-migrationjakarta-eeweb-containersservlet-6.1
JavaGuide
Written by

JavaGuide

Backend tech guide and AI engineering practice covering fundamentals, databases, distributed systems, high concurrency, system design, plus AI agents and large-model engineering.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.