Philipp Förmer created CXF-7592:
-----------------------------------
Summary: Request filter handling wrong JAX-RS 2.1 implementation
Key: CXF-7592
URL: https://issues.apache.org/jira/browse/CXF-7592
Project: CXF
Issue Type: Bug
Components: JAX-RS
Affects Versions: 3.2.1, 3.2.0
Reporter: Philipp Förmer
In JAX-RS 2.1 specification chapter "6.7.1 Server runtime" it is said that:
{quote}
[...]When a filter or interceptor method throws an exception, the server
runtime will process the exception as described in Section 4.5.1.[...]
{quote}
But if a JAX-RS ContainerRequestFilter throws an IOException, then the
IOException is immediately catched in
JAXRSUtils.runContainerRequestFilters(...) without passing it to exception
mapper provider.
Use case:
We have a ContainerRequestFilter which reads the json request data with
jackson. For a special failure scenario the jackson mapper throws a
JsonMappingException. The super type of JsonMappingException is IOException. As
CXF catches the IOException the JsonMappingException is not delegated to a
custom exception mapper, which performs the mapping from JsonMappingException
to the response. As of this, the unexpected status code Internal Server Error
is returned.
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)