[
https://issues.apache.org/jira/browse/CXF-7592?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16297117#comment-16297117
]
Sergey Beryozkin commented on CXF-7592:
---------------------------------------
Thanks, not sure now why it was not done correctly at the start, may be I
thought IOException would never be thrown from the filters :-)
> Wrong JAX-RS 2.1 request filter handling for IOException
> --------------------------------------------------------
>
> Key: CXF-7592
> URL: https://issues.apache.org/jira/browse/CXF-7592
> Project: CXF
> Issue Type: Bug
> Components: JAX-RS
> Affects Versions: 3.2.0, 3.2.1
> Reporter: Philipp Förmer
> Assignee: Sergey Beryozkin
> Fix For: 3.1.15, 3.2.2
>
>
> 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)