Return-Path: X-Original-To: apmail-cxf-issues-archive@www.apache.org Delivered-To: apmail-cxf-issues-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id D4FA9FEE1 for ; Tue, 16 Apr 2013 22:01:16 +0000 (UTC) Received: (qmail 16445 invoked by uid 500); 16 Apr 2013 22:01:16 -0000 Delivered-To: apmail-cxf-issues-archive@cxf.apache.org Received: (qmail 16410 invoked by uid 500); 16 Apr 2013 22:01:16 -0000 Mailing-List: contact issues-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cxf.apache.org Delivered-To: mailing list issues@cxf.apache.org Received: (qmail 16401 invoked by uid 99); 16 Apr 2013 22:01:16 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 16 Apr 2013 22:01:16 +0000 Date: Tue, 16 Apr 2013 22:01:16 +0000 (UTC) From: "Antoine Reilles (JIRA)" To: issues@cxf.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Comment Edited] (CXF-4969) ExceptionMapper not used for exception in resource setter MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CXF-4969?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13633337#comment-13633337 ] Antoine Reilles edited comment on CXF-4969 at 4/16/13 9:59 PM: --------------------------------------------------------------- Sorry, I forgot to attach the test war. It is done now. was (Author: areilles): Test war > 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 > 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: > http://localhost/testexceptions/a/b/fail_in_inject > where the exception is raised at the setter level an HTTP 500 response, with entity > xmlns:ns1="http://cxf.apache.org/bindings/xformat"> > xmlns:ns1="http://cxf.apache.org/bindings/xformat">javax.ws.rs.WebApplicationException > > > and a stack in the server logs, when > http://localhost/testexceptions/a/b/fail_in_serve > 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