You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "Jorge L. Williams (JIRA)" <ji...@apache.org> on 2009/07/31 23:08:14 UTC

[jira] Created: (CXF-2374) Handle possible number format exception when reading primitive param

Handle possible number format exception when reading primitive param
--------------------------------------------------------------------

                 Key: CXF-2374
                 URL: https://issues.apache.org/jira/browse/CXF-2374
             Project: CXF
          Issue Type: Bug
          Components: REST
            Reporter: Jorge L. Williams
            Priority: Minor


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 :-)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (CXF-2374) Handle possible number format exception when reading primitive param

Posted by "Jorge L. Williams (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CXF-2374?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jorge L. Williams updated CXF-2374:
-----------------------------------

    Attachment: 0001-Handle-possible-number-format-exception-when-reading.patch

> Handle possible number format exception when reading primitive param
> --------------------------------------------------------------------
>
>                 Key: CXF-2374
>                 URL: https://issues.apache.org/jira/browse/CXF-2374
>             Project: CXF
>          Issue Type: Bug
>          Components: REST
>            Reporter: Jorge L. Williams
>            Priority: Minor
>         Attachments: 0001-Handle-possible-number-format-exception-when-reading.patch
>
>
> 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 :-)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (CXF-2374) Handle possible number format exception when reading primitive param

Posted by "Daniel Kulp (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CXF-2374?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Daniel Kulp resolved CXF-2374.
------------------------------

       Resolution: Fixed
    Fix Version/s: 2.2.4
         Assignee: Daniel Kulp

> Handle possible number format exception when reading primitive param
> --------------------------------------------------------------------
>
>                 Key: CXF-2374
>                 URL: https://issues.apache.org/jira/browse/CXF-2374
>             Project: CXF
>          Issue Type: Bug
>          Components: REST
>            Reporter: Jorge L. Williams
>            Assignee: Daniel Kulp
>            Priority: Minor
>             Fix For: 2.2.4
>
>         Attachments: 0001-Handle-possible-number-format-exception-when-reading.patch
>
>
> 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 :-)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.