You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Andrea Cosentino (JIRA)" <ji...@apache.org> on 2019/05/07 12:59:00 UTC
[jira] [Resolved] (CAMEL-13489) camel-undertow: consumer thrown NPE
when the body cannot be converted to ByteBuffer
[ https://issues.apache.org/jira/browse/CAMEL-13489?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Andrea Cosentino resolved CAMEL-13489.
--------------------------------------
Resolution: Fixed
> camel-undertow: consumer thrown NPE when the body cannot be converted to ByteBuffer
> -----------------------------------------------------------------------------------
>
> Key: CAMEL-13489
> URL: https://issues.apache.org/jira/browse/CAMEL-13489
> Project: Camel
> Issue Type: Bug
> Components: camel-undertow
> Reporter: Luca Burgazzoli
> Assignee: Luca Burgazzoli
> Priority: Minor
> Fix For: 3.0.0, 2.24.0
>
>
> Assuming we have a simple route like:
> {code}
> from("undertow:http://localhost:{{port}}/incompatibleData")
> .transform().constant(Collections.singletonMap("key", "val"));
> {code}
> This code will cause an NPE on UndertowConsumer because the body cannot be converted to a ByteBuffer [1], instead of an NPE we should use mandatoryConvertTo so the exception is more clear.
> [1] https://github.com/apache/camel/blob/master/components/camel-undertow/src/main/java/org/apache/camel/component/undertow/UndertowConsumer.java#L156
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)