[
https://issues.apache.org/jira/browse/CAMEL-8797?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14560577#comment-14560577
]
Calle Kabo commented on CAMEL-8797:
-----------------------------------
Well, that didn't work as expected.
{code}
Failed delivery for (MessageId: messageid on ExchangeId:
ID-vurten-centos-demo-1-37698-1432712384273-0-7). On delivery attempt: 0
caught: org.apache.camel.language.bean.RuntimeBeanExpressionException: Failed
to invoke method: .bodyLength on null due to:
org.apache.camel.language.bean.RuntimeBeanExpressionException: Failed to invoke
method: bodyLength on null due to:
org.apache.camel.component.bean.MethodNotFoundException: Method with name:
bodyLength not found on bean: [B@1d4b808d of type: [B.
Exchange[JmsMessage[JmsMessageID:
ID:vurten-centos-demo-1-60101-1432710490465-5:2:1:1:1]]
{code}
Perhaps there has been some <convertBodyTo type="byte[]" /> earlier somewhere.
But now I have more to go on. Many thanks for your assistance!
> byte array length is not correct in simple
> ------------------------------------------
>
> Key: CAMEL-8797
> URL: https://issues.apache.org/jira/browse/CAMEL-8797
> Project: Camel
> Issue Type: Bug
> Reporter: Calle Kabo
> Assignee: Claus Ibsen
>
> I have a byte[] containing an XML.
> {code}
> <log message="Body is '${in.body.getClass.getCanonicalName}'"
> loggingLevel="DEBUG"/>
> <log message="Body = '${in.body}'" loggingLevel="DEBUG"/>
> <choice>
> <when>
> <simple>${in.body} is
> 'java.io.File'</simple>
> <setHeader
> headerName="CamelAwsS3ContentLength">
> <simple>${file:size}</simple>
> </setHeader>
> </when>
> <otherwise>
> <setHeader
> headerName="CamelAwsS3ContentLength">
> <simple>${in.body.length}</simple>
> </setHeader>
> </otherwise>
> </choice>
> <log message="Body length = ${in.header.CamelAwsS3ContentLength}"
> loggingLevel="DEBUG"/>
> {code}
> The above code outputs the following in the logs:
> {code}
> Body is 'byte[]'
> Body = '<?xml version="1.0" encoding="ISO-8859-1"?><root> /... bla bla bla
> .../ </root>'
> Body length = 1
> {code}
> Using Camel 2.14.0.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)