eclipse-ee4j / eclipse-ee4j/jersey

Jersey 3.1.10: ContainerResponse.close() triggers responseWriter.failure(e) → sendError(500, "Request failed."), losing exception message (regression vs 2.35)

Open
#6,012 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
730
Forks
382
PR merge metrics
No merged PRs in 30d

Description

Environment:
jersey-server: 3.1.10 (previously 2.35)
Spring Boot: 3.x
Servlet container: Tomcat 9.0.108
Java: 21

Problem:
After upgrading from Jersey 2.35 to 3.1.10, failures routed through ContainerResponse.close() now invoke responseWriter.failure(e), which results in HttpServletResponse.sendError(500, "Request failed."). The client receives a generic message instead of the original exception message or our structured error body. In 2.35 the exception message reached the client. This change broke part of our automated tests in a synthetic test application that validates detailed error text/stack trace.

Questions:
Was this behavioral change intentional, and is it documented in 2.x → 3.x migration notes?
What is the official, supported way to restore 2.35-style behavior where the exception message/body is returned to the client?
Is there a recommended flag/configuration or extension hook to customize the behavior of failures (e.g., avoid the fixed “Request failed.” text) in a supported manner, suitable for test environments?
If this is an unintended regression, would you consider adjusting the default or providing a dedicated configuration switch?

Contributor guide

Open the contributing guide

Research direction

Start by tracing ContainerResponse.close() into responseWriter.failure(e) and the resulting HttpServletResponse.sendError(500, "Request failed.") behavior in Jersey 3.1.10, then compare it with Jersey 2.35. Check the 2.x → 3.x migration notes and the synthetic test application; done means the supported behavior or configuration for preserving exception messages and structured error bodies is documented or identified.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api, backend
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.