Skip to content

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

@LordOfTheHouse

Description

@LordOfTheHouse

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions