Return-Path: Delivered-To: apmail-camel-dev-archive@www.apache.org Received: (qmail 85334 invoked from network); 25 Sep 2010 11:53:09 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 25 Sep 2010 11:53:09 -0000 Received: (qmail 67264 invoked by uid 500); 25 Sep 2010 11:53:09 -0000 Delivered-To: apmail-camel-dev-archive@camel.apache.org Received: (qmail 67134 invoked by uid 500); 25 Sep 2010 11:53:06 -0000 Mailing-List: contact dev-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 dev@camel.apache.org Received: (qmail 67126 invoked by uid 500); 25 Sep 2010 11:53:05 -0000 Delivered-To: apmail-activemq-camel-dev@activemq.apache.org Received: (qmail 67123 invoked by uid 99); 25 Sep 2010 11:53:05 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 25 Sep 2010 11:53:05 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.22] (HELO thor.apache.org) (140.211.11.22) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 25 Sep 2010 11:53:03 +0000 Received: from thor (localhost [127.0.0.1]) by thor.apache.org (8.13.8+Sun/8.13.8) with ESMTP id o8PBqe2D013578 for ; Sat, 25 Sep 2010 11:52:41 GMT Message-ID: <32673222.31821285415560416.JavaMail.jira@thor> Date: Sat, 25 Sep 2010 07:52:40 -0400 (EDT) From: "Claus Ibsen (JIRA)" To: camel-dev@activemq.apache.org Subject: [jira] Commented: (CAMEL-3151) NullPointerException in CXF Producer if no type converter is available In-Reply-To: <8014009.29091285239520470.JavaMail.jira@thor> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: ae95407df07c98740808b2ef9da0087c X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/activemq/browse/CAMEL-3151?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=62102#action_62102 ] Claus Ibsen commented on CAMEL-3151: ------------------------------------ Can you attach a small unit test which demonstrates this? And what content in the message do you send? > NullPointerException in CXF Producer if no type converter is available > ---------------------------------------------------------------------- > > Key: CAMEL-3151 > URL: https://issues.apache.org/activemq/browse/CAMEL-3151 > Project: Apache Camel > Issue Type: Bug > Components: camel-cxf > Reporter: Stephan Siano > Priority: Minor > > When I am trying to send the content of a file to an CXF endpoint in PAYLOAD format, I get a NullPointerException in line 603 of the CXFEndpoint class (in the current trunk). The offending coding is: > CxfPayload payload = (CxfPayload)params[0]; > List elements = payload.getBody(); > The params are set in line 282 of the CxfProducer class: > params = new Object[1]; > // TODO: maybe it should be mandatory body? > params[0] = exchange.getIn().getBody(CxfPayload.class); > The fix is most probably trivial (change to getMandatoryBody()) and add a throws InvalidPayloadException to the getParams() method of CxfProducer). After this is fixed (the same for the MESSAGE format two lines lower), the example will still not work, but I get a meaningful error message saying that there is no type converter between GenericFile and CxfPayload. > One could argue, that under some circumstances null payloads may be legal (I just don't see any), but in this case the CxfEndpoint class would have to be modified to avoid the NullPointerException. As the coding is a missing converter or a null payload will trigger NullPointerExceptions for CxfEndpoints unconditionally. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.