Return-Path: X-Original-To: apmail-camel-issues-archive@minotaur.apache.org Delivered-To: apmail-camel-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 0253218CEB for ; Fri, 16 Oct 2015 21:55:06 +0000 (UTC) Received: (qmail 72872 invoked by uid 500); 16 Oct 2015 21:55:05 -0000 Delivered-To: apmail-camel-issues-archive@camel.apache.org Received: (qmail 72833 invoked by uid 500); 16 Oct 2015 21:55:05 -0000 Mailing-List: contact issues-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@camel.apache.org Delivered-To: mailing list issues@camel.apache.org Received: (qmail 72731 invoked by uid 99); 16 Oct 2015 21:55:05 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 16 Oct 2015 21:55:05 +0000 Date: Fri, 16 Oct 2015 21:55:05 +0000 (UTC) From: "Ron Ten-Hove (JIRA)" To: issues@camel.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (CAMEL-9230) CXFRS NPE when response code not in Response.Status 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/CAMEL-9230?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Ron Ten-Hove updated CAMEL-9230: -------------------------------- Attachment: CAMEL-9230-reproduction.patch Diff to create unit test that reproduces the issue. Diff from 2.15.3. > CXFRS NPE when response code not in Response.Status > --------------------------------------------------- > > Key: CAMEL-9230 > URL: https://issues.apache.org/jira/browse/CAMEL-9230 > Project: Camel > Issue Type: Bug > Components: camel-cxfrs > Affects Versions: 2.15.3 > Reporter: Ron Ten-Hove > Attachments: CAMEL-9230-reproduction.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 (v6.3.4#6332)