You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "Sergey Beryozkin (JIRA)" <ji...@apache.org> on 2013/04/17 23:23:19 UTC
[jira] [Resolved] (CXF-4969) ExceptionMapper not used for exception
in resource setter
[ https://issues.apache.org/jira/browse/CXF-4969?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Sergey Beryozkin resolved CXF-4969.
-----------------------------------
Resolution: Fixed
Fix Version/s: 2.7.5
2.6.8
2.8.0
Assignee: Sergey Beryozkin
Please try 2.6.8-SNAPSHOT in a couple of days
> ExceptionMapper not used for exception in resource setter
> ---------------------------------------------------------
>
> Key: CXF-4969
> URL: https://issues.apache.org/jira/browse/CXF-4969
> Project: CXF
> Issue Type: Bug
> Components: JAX-RS
> Affects Versions: 2.6.7
> Environment: tomee-1.6.0-SNAPSHOT
> Reporter: Antoine Reilles
> Assignee: Sergey Beryozkin
> Fix For: 2.8.0, 2.6.8, 2.7.5
>
> Attachments: testexceptions-src.zip, testexceptions.war
>
>
> I'm trying to use the cxf extension that allows to map exceptions to reponses. The issue I have is that exceptions raised in setXX methods annontated with @PathParam for example are caught and produce an internal server error. This prevents from performing usefull parameter validation from the setter methods, where they could benefit to all services.
> Attached in a sample application that defines a custom mapper, and raises exceptions either in a setter or a service method.
> Once deployed, I do get for:
> {code}
> http://localhost/testexceptions/a/b/fail_in_inject
> {code}
> where the exception is raised at the setter level an HTTP 500 response, with entity
> {code:xml}
> <ns1:XMLFault
> xmlns:ns1="http://cxf.apache.org/bindings/xformat">
> <ns1:faultstring
> xmlns:ns1="http://cxf.apache.org/bindings/xformat">javax.ws.rs.WebApplicationException
> </ns1:faultstring>
> </ns1:XMLFault>
> {code}
> and a stack in the server logs, when
> {code}
> http://localhost/testexceptions/a/b/fail_in_serve
> {code}
> where the exception is raised at service level correctly returns HTTP 400
> One sould be able to use the setter methods (or the resource constructor) to perform parameters validation, and property return errors.
> Tested with tomee 1.6.0, which ships with cxf-2.6.7
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira