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

Mark White updated CAMEL-1865:
------------------------------

    Attachment: MySplitter.java

Sure, attached.

Splitter makes a copy of the original (in.copy()) and adds a body and header, 
then returns message in the list.

If it instead is changed to just return the original message in the list, it 
doesn't throw NPE.

Thanks


> NPE thrown when DEBUG logging on
> --------------------------------
>
>                 Key: CAMEL-1865
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-1865
>             Project: Apache Camel
>          Issue Type: Bug
>          Components: camel-core
>    Affects Versions: 2.0-M3
>         Environment: 2.0-M3
>            Reporter: Mark White
>         Attachments: MySplitter.java
>
>
> Stack trace;
> org.apache.camel.language.bean.RuntimeBeanExpressionException: Failed to 
> invoke method: doSplit on MySplitter due to: java.lang.NullPointerException
>         at 
> org.apache.camel.language.bean.BeanExpression.evaluate(BeanExpression.java:82)
>         at 
> org.apache.camel.language.bean.BeanExpression.evaluate(BeanExpression.java:87)
>         at 
> org.apache.camel.processor.Splitter.createProcessorExchangePairs(Splitter.java:72)
> ...
> Caused by: java.lang.NullPointerException
>         at 
> org.apache.camel.util.MessageHelper.extractBodyForLogging(MessageHelper.java:129)
>         at 
> org.apache.camel.impl.DefaultMessage.toString(DefaultMessage.java:38)
>         at java.lang.String.valueOf(String.java:2827)
>         at java.lang.StringBuilder.append(StringBuilder.java:115)
>         at java.util.AbstractCollection.toString(AbstractCollection.java:422)
>         at java.lang.String.valueOf(String.java:2827)
>         at java.lang.StringBuilder.append(StringBuilder.java:115)
>         at 
> org.apache.camel.component.bean.BeanProcessor.process(BeanProcessor.java:139)
> Steps to reproduce;
> 1. Create simple route with splitter pattern; e.g.
> <route>
>       <from uri="jms:IN_QUEUE"/>
>       <split><method bean="MySplitter" method="doSplit"/>
>               <to uri="log:route.log"/>
>       </split>
> </route>
> 2. Set DEBUG logging on for org.apache.camel classes, e.g.
> log4j.logger.org.apache.camel=DEBUG
> 3. Fire message into route - message fails with NPE inside Camel

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to