Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-1865

NPE thrown when DEBUG logging on

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.0-M3
    • 2.0.0
    • camel-core
    • None
    • 2.0-M3

    Description

      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

      Attachments

        1. MySplitter.java
          0.5 kB
          Mark White

        Activity

          People

            davsclaus Claus Ibsen
            msjwhite Mark White
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: