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 C8539D977 for ; Tue, 4 Sep 2012 10:31:08 +0000 (UTC) Received: (qmail 77636 invoked by uid 500); 4 Sep 2012 10:31:08 -0000 Delivered-To: apmail-cxf-issues-archive@cxf.apache.org Received: (qmail 77521 invoked by uid 500); 4 Sep 2012 10:31:08 -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 77499 invoked by uid 99); 4 Sep 2012 10:31:07 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 04 Sep 2012 10:31:07 +0000 Date: Tue, 4 Sep 2012 21:31:07 +1100 (NCT) From: "n0rad (JIRA)" To: issues@cxf.apache.org Message-ID: <819037755.32118.1346754667625.JavaMail.jiratomcat@arcas> In-Reply-To: <20699671.30834.1346692987869.JavaMail.jiratomcat@arcas> Subject: [jira] [Commented] (CXF-4496) find of ResponseExceptionMapper do not handle runtime exceptions MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CXF-4496?page=3Dcom.atlassian.j= ira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D134476= 00#comment-13447600 ]=20 n0rad commented on CXF-4496: ---------------------------- but if the ExceptionMapper store the real class into the payload (for examp= le SecurityException) The client side should be able to reconstruct this Exception, and its worki= ng if you add throws RuntimeException into the signature. =20 > find of ResponseExceptionMapper do not handle runtime exceptions > ---------------------------------------------------------------- > > Key: CXF-4496 > URL: https://issues.apache.org/jira/browse/CXF-4496 > Project: CXF > Issue Type: Bug > Components: JAX-RS > Affects Versions: 2.6.2 > Reporter: n0rad > Priority: Minor > > In org.apache.cxf.jaxrs.client.ClientProxyImpl.findExceptionMapper(Method= , Message) > The responseExceptionMapper is selected based on exception defined in the= resource method signature but this method may have thrown a RuntimeExcepti= on : > {code:java}=20 > @Path("/") > public interface RestMcuBoardResource { > @GET > public RestMcuBoard getBoard(); > } > {code}=C2=A0 > does not work where this one work > {code:java}=20 > @Path("/") > public interface RestMcuBoardResource { > @GET > public RestMcuBoard getBoard() throws runtimeException; > } > {code} > a fix could be : > {code:java}=20 > private static ResponseExceptionMapper findExceptionMapper(Method = m, Message message) { > ProviderFactory pf =3D ProviderFactory.getInstance(message); > for (Class exType : m.getExceptionTypes()) { > ResponseExceptionMapper mapper =3D pf.createResponseExcept= ionMapper(exType); > if (mapper !=3D null) { > return mapper; > } > } > + return pf.createResponseExceptionMapper(RuntimeException.class); > - return null;=20 > } > {code}=20 -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrato= rs For more information on JIRA, see: http://www.atlassian.com/software/jira