camel-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ron Ten-Hove (JIRA)" <>
Subject [jira] [Updated] (CAMEL-9230) CXFRS NPE when response code not in Response.Status
Date Fri, 16 Oct 2015 22:01:06 GMT


Ron Ten-Hove updated CAMEL-9230:
    Attachment: CAMEL-9230.patch

Attached is a patch that resolves the issue. When it finds that JAX-RS does not know the given
response status code, it substitutes the code's family (e.g., Client error) instead.

> CXFRS NPE when response code not in Response.Status
> ---------------------------------------------------
>                 Key: CAMEL-9230
>                 URL:
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-cxfrs
>    Affects Versions: 2.15.3
>            Reporter: Ron Ten-Hove
>         Attachments: CAMEL-9230-reproduction.patch, CAMEL-9230.patch
> When used as a producer, the CXFRS component's {{org.apache.camel.component.cxf.jaxrs.CxfRsProducer#populateCxfRsProducerException}}
method converts the received HTTP response status code to text:
> {{String statusText = Response.Status.fromStatusCode(responseCode).toString();}}
> If the JAX-RS-supplied {{fromStatusCode}} method does not recognize the status code provided,
it returns {{null}}, causing the CxfRsProducer to thrown an NPE. 
> Note that {{Response.Status}} does not know all response codes. I ran afoul of this when
a REST service returned a 422 for a validation error.
> I will attach a unit test that illustrates this problem, as a patch to the current unit
tests for the class.

This message was sent by Atlassian JIRA

View raw message