You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "Fabien Thouny (JIRA)" <ji...@apache.org> on 2013/10/21 17:41:43 UTC

[jira] [Updated] (CXF-5348) Exception mappers implementing ExceptionMapper through an abstract class are not mapped to the declared exception

     [ https://issues.apache.org/jira/browse/CXF-5348?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Fabien Thouny updated CXF-5348:
-------------------------------

    Attachment: hierarchical-exception-mapper.zip

> Exception mappers implementing ExceptionMapper through an abstract class are not mapped to the declared exception 
> ------------------------------------------------------------------------------------------------------------------
>
>                 Key: CXF-5348
>                 URL: https://issues.apache.org/jira/browse/CXF-5348
>             Project: CXF
>          Issue Type: Bug
>          Components: JAX-RS
>    Affects Versions: 2.7.7
>            Reporter: Fabien Thouny
>            Priority: Minor
>         Attachments: hierarchical-exception-mapper.zip
>
>
> If we consider the following exception mapper, all Throwables will be mapped instead of only the SomeClientExceptions :
> {code}
> @Provider
> public class SomeClientExceptionMapper extends AbstractBadRequestExceptionMapper<SomeClientException> {}
> abstract class AbstractBadRequestExceptionMapper<T extends Throwable> implements ExceptionMapper<T> {
>     @Override
>     public Response toResponse(T exception) {
>         return Response.status(Status.BAD_REQUEST).entity(exception.getMessage()).build();
>     }
> }
> {code}
> Please find attached, a sample project with some ITs showing the problem.



--
This message was sent by Atlassian JIRA
(v6.1#6144)