Return-Path: Delivered-To: apmail-cxf-dev-archive@www.apache.org Received: (qmail 30353 invoked from network); 31 Jul 2009 20:55:10 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 31 Jul 2009 20:55:10 -0000 Received: (qmail 39335 invoked by uid 500); 31 Jul 2009 20:55:10 -0000 Delivered-To: apmail-cxf-dev-archive@cxf.apache.org Received: (qmail 39255 invoked by uid 500); 31 Jul 2009 20:55:10 -0000 Mailing-List: contact dev-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 dev@cxf.apache.org Received: (qmail 39245 invoked by uid 99); 31 Jul 2009 20:55:10 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 31 Jul 2009 20:55:10 +0000 X-ASF-Spam-Status: No, hits=1.2 required=10.0 tests=SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [216.40.44.159] (HELO smtprelay.hostedemail.com) (216.40.44.159) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 31 Jul 2009 20:54:58 +0000 Received: from filter.hostedemail.com (ff-bigip1 [10.5.19.254]) by smtprelay01.hostedemail.com (Postfix) with SMTP id 7204625A1C96 for ; Fri, 31 Jul 2009 20:54:36 +0000 (UTC) X-Spam-Summary: 50,0,0,2b743a05244e5f66,d41d8cd98f00b204,dkulp@apache.org,dev@cxf.apache.org:jorge.williams@rackspace.com,RULES_HIT:355:379:560:599:600:601:800:967:973:980:988:989:1260:1277:1311:1312:1313:1314:1345:1359:1437:1515:1516:1518:1519:1534:1541:1593:1594:1595:1596:1711:1730:1747:1766:1792:2379:2393:2525:2553:2560:2564:2682:2685:2828:2857:2859:2892:2933:2937:2939:2942:2945:2947:2951:2954:3022:3027:3353:3636:3865:3866:3867:3868:3869:3870:3871:3872:3873:3874:3934:3936:3938:3941:3944:3947:3950:3953:3956:3959:4250:4321:5007:6119:6261:7679:7903:8828:8957:8985:9025:9388:10004,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fu,MSBL:none,DNSBL:none,Custom_rules:0:0:0 X-Session-Marker: 64616E406B756C702E636F6D X-Filterd-Recvd-Size: 3247 Received: from server.dankulp.com (server1.dankulp.com [66.207.172.168]) (Authenticated sender: dan@kulp.com) by omf02.hostedemail.com (Postfix) with ESMTP for ; Fri, 31 Jul 2009 20:54:35 +0000 (UTC) Received: by server.dankulp.com (Postfix, from userid 5000) id D6D3C507003B; Fri, 31 Jul 2009 16:54:35 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 3.2.1-gr1 (2007-05-02) on server.dankulp.com X-Spam-Level: X-Msg-File: /tmp/mailfilter.GGoVasqMAW Received: from dilbert.localnet (c-24-91-141-225.hsd1.ma.comcast.net [24.91.141.225]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by server.dankulp.com (Postfix) with ESMTPSA id D4A495070038; Fri, 31 Jul 2009 16:54:34 -0400 (EDT) From: Daniel Kulp To: dev@cxf.apache.org Subject: Re: PATCH: JAX-RS Handle possible number format exception when reading primitive param Date: Fri, 31 Jul 2009 16:54:29 -0400 User-Agent: KMail/1.11.4 (Linux/2.6.30-gentoo-r1; KDE/4.2.4; x86_64; ; ) Cc: Jorge Williams References: <23611_1249072000_n6VKQXwh010540_19B60314-6566-402E-85BE-F011D727DEBC@rackspace.com> In-Reply-To: <23611_1249072000_n6VKQXwh010540_19B60314-6566-402E-85BE-F011D727DEBC@rackspace.com> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200907311654.30717.dkulp@apache.org> X-Virus-Checked: Checked by ClamAV on apache.org X-Old-Spam-Status: No, score=-3.3 required=3.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.1-gr1 Can you file a JIRA at: https://issues.apache.org/jira/browse/CXF and attach the patch there. The Apache mail system stripped off the attachment. Dan On Fri July 31 2009 4:27:12 pm Jorge Williams wrote: > Hello all, > > We ran into this issue in JAX-RS: A request to something like /path/ > to/{id} where {id} is expected to be an integer would throw a > NumberFormatException in the case where we send something other than > an integer (/path/to/bla, for example). The NumberFormatException > didn't find its way to our ExceptionMapper and resulted in an XMLFault > being serialized which is wrong. > > The attached patch fixes things for us. We simply capture the NFE and > resend it as a WebApplicationException -- we send a 404 when we're > dealing with path params and 400 otherwise. The patch is against the > current trunk but honestly we've really only tested against 2.2.2 -- > since that's what we're using :-) > > Regards, > > jOrGe W. > > > > > Confidentiality Notice: This e-mail message (including any attached or > embedded documents) is intended for the exclusive and confidential use of > the individual or entity to which this message is addressed, and unless > otherwise expressly indicated, is confidential and privileged information > of Rackspace. Any dissemination, distribution or copying of the enclosed > material is prohibited. If you receive this transmission in error, please > notify us immediately by e-mail at abuse@rackspace.com, and delete the > original message. > Your cooperation is appreciated. -- Daniel Kulp dkulp@apache.org http://www.dankulp.com/blog