camel-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Claus Ibsen (JIRA)" <j...@apache.org>
Subject [jira] Assigned: (CAMEL-3151) NullPointerException in CXF Producer if no type converter is available
Date Sun, 03 Oct 2010 10:43:40 GMT

     [ https://issues.apache.org/activemq/browse/CAMEL-3151?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Claus Ibsen reassigned CAMEL-3151:
----------------------------------

    Assignee: Claus Ibsen

> 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
>            Assignee: Claus Ibsen
>            Priority: Minor
>             Fix For: 2.5.0
>
>
> 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<Element> 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.


Mime
View raw message