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

NullPointerException is generated when Flatpack component is used with Tracer

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.4.0
    • 1.5.0
    • camel-flatpack
    • None

    Description

      Hi,

      The following error is returned when Tracer is activated for the Flatpack component :

      4317672 [Thread: 2 org.apache.camel.component.file.FileComponent@14f5a31] INFO org.apache.camel.processor.interceptor.TraceInterceptor - ID-dell-charles/1671-1218196761734/1-1 -> interceptor2 Interceptor[Delegate(DeadLetterChannel[Delegate(TraceInterceptor[To[flatpack:fixed:com/bravura/babel/transformation/cutas/in/CUTAS.xml]]), sendTo(Endpoint[seda:errors]), RedeliveryPolicy[maximumRedeliveries=1]])] InOnly Properties:

      {org.apache.camel.file.lock.name=c:\temp\cutas\input\clientA\ST000355.txt.cameLock, org.apache.camel.file.lock=sun.nio.ch.FileLockImpl[0:9223372036854775807 exclusive valid], org.apache.camel.fileChannel=sun.nio.ch.FileChannelImpl@4610fa}

      Headers:

      {org.apache.camel.file.name=ST000355.txt} BodyType:java.io.File
      4317672 [Thread: 2 org.apache.camel.component.file.FileComponent@14f5a31] INFO org.apache.camel.processor.interceptor.TraceInterceptor - ID-dell-charles/1671-1218196761734/1-1 -> to4 To[flatpack:fixed:com/bravura/babel/transformation/cutas/in/CUTAS.xml] InOnly Properties:{CamelCauseException=null, org.apache.camel.file.lock.name=c:\temp\cutas\input\clientA\ST000355.txt.cameLock, org.apache.camel.file.lock=sun.nio.ch.FileLockImpl[0:9223372036854775807 exclusive valid], org.apache.camel.fileChannel=sun.nio.ch.FileChannelImpl@4610fa} Headers:{org.apache.camel.file.name=ST000355.txt}

      BodyType:java.io.File
      4318031 [Thread: 2 org.apache.camel.component.file.FileComponent@14f5a31] INFO org.apache.camel.processor.interceptor.TraceInterceptor - ID-dell-charles/1671-1218196761734/1-2 -> interceptor3 Interceptor[Delegate(DeadLetterChannel[Delegate(TraceInterceptor[To[activemq:queue:cutas.clientA.accepted.in]]), sendTo(Endpoint[seda:errors]), RedeliveryPolicy[maximumRedeliveries=1]])] InOnly Properties:{} Headers:

      {camelFlatpackCounter=0} BodyType:net.sf.flatpack.DefaultDataSet
      4318031 [Thread: 2 org.apache.camel.component.file.FileComponent@14f5a31] INFO org.apache.camel.processor.interceptor.TraceInterceptor - ID-dell-charles/1671-1218196761734/1-2 -> to5 To[activemq:queue:cutas.clientA.accepted.in] InOnly Properties:{CamelCauseException=null} Headers:{camelFlatpackCounter=0}

      BodyType:net.sf.flatpack.DefaultDataSet
      4318172 [Thread: 2 org.apache.camel.component.file.FileComponent@14f5a31] INFO org.apache.camel.processor.interceptor.TraceInterceptor - ID-dell-charles/1671-1218196761734/1-3 -> interceptor3 Interceptor[Delegate(DeadLetterChannel[Delegate(TraceInterceptor[To[activemq:queue:cutas.clientA.accepted.in]]), sendTo(Endpoint[seda:errors]), RedeliveryPolicy[maximumRedeliveries=1]])] InOnly Properties:{} Headers:

      {camelFlatpackCounter=1} BodyType:net.sf.flatpack.DefaultDataSet
      4318172 [Thread: 2 org.apache.camel.component.file.FileComponent@14f5a31] INFO org.apache.camel.processor.interceptor.TraceInterceptor - ID-dell-charles/1671-1218196761734/1-3 -> to5 To[activemq:queue:cutas.clientA.accepted.in] InOnly Properties:{CamelCauseException=null} Headers:{camelFlatpackCounter=1}

      BodyType:net.sf.flatpack.DefaultDataSet
      4318172 [Thread: 2 org.apache.camel.component.file.FileComponent@14f5a31] INFO org.apache.camel.processor.interceptor.TraceInterceptor - ID-dell-charles/1671-1218196761734/1-4 -> interceptor3 Interceptor[Delegate(DeadLetterChannel[Delegate(TraceInterceptor[To[activemq:queue:cutas.clientA.accepted.in]]), sendTo(Endpoint[seda:errors]), RedeliveryPolicy[maximumRedeliveries=1]])] InOnly Properties:{} Headers:

      {camelFlatpackCounter=2} BodyType:net.sf.flatpack.DefaultDataSet
      4318172 [Thread: 2 org.apache.camel.component.file.FileComponent@14f5a31] INFO org.apache.camel.processor.interceptor.TraceInterceptor - ID-dell-charles/1671-1218196761734/1-4 -> to5 To[activemq:queue:cutas.clientA.accepted.in] InOnly Properties:{CamelCauseException=null} Headers:{camelFlatpackCounter=2}

      BodyType:net.sf.flatpack.DefaultDataSet
      4318172 [Thread: 2 org.apache.camel.component.file.FileComponent@14f5a31] INFO org.apache.camel.processor.interceptor.TraceInterceptor - ID-dell-charles/1671-1218196761734/1-5 -> interceptor3 Interceptor[Delegate(DeadLetterChannel[Delegate(TraceInterceptor[To[activemq:queue:cutas.clientA.accepted.in]]), sendTo(Endpoint[seda:errors]), RedeliveryPolicy[maximumRedeliveries=1]])] InOnly Properties:{} Headers:

      {camelFlatpackCounter=3} BodyType:net.sf.flatpack.DefaultDataSet
      4318172 [Thread: 2 org.apache.camel.component.file.FileComponent@14f5a31] INFO org.apache.camel.processor.interceptor.TraceInterceptor - ID-dell-charles/1671-1218196761734/1-5 -> to5 To[activemq:queue:cutas.clientA.accepted.in] InOnly Properties:{CamelCauseException=null} Headers:{camelFlatpackCounter=3}

      BodyType:net.sf.flatpack.DefaultDataSet
      4318172 [Thread: 2 org.apache.camel.component.file.FileComponent@14f5a31] INFO org.apache.camel.processor.interceptor.TraceInterceptor - ID-dell-charles/1671-1218196761734/1-6 -> interceptor3 Interceptor[Delegate(DeadLetterChannel[Delegate(TraceInterceptor[To[activemq:queue:cutas.clientA.accepted.in]]), sendTo(Endpoint[seda:errors]), RedeliveryPolicy[maximumRedeliveries=1]])] InOnly Properties:{} Headers:

      {camelFlatpackCounter=4} BodyType:net.sf.flatpack.DefaultDataSet
      4318172 [Thread: 2 org.apache.camel.component.file.FileComponent@14f5a31] INFO org.apache.camel.processor.interceptor.TraceInterceptor - ID-dell-charles/1671-1218196761734/1-6 -> to5 To[activemq:queue:cutas.clientA.accepted.in] InOnly Properties:{CamelCauseException=null} Headers:{camelFlatpackCounter=4}

      BodyType:net.sf.flatpack.DefaultDataSet
      4318172 [Thread: 2 org.apache.camel.component.file.FileComponent@14f5a31] INFO org.apache.camel.processor.interceptor.TraceInterceptor - ID-dell-charles/1671-1218196761734/1-7 -> interceptor3 Interceptor[Delegate(DeadLetterChannel[Delegate(TraceInterceptor[To[activemq:queue:cutas.clientA.accepted.in]]), sendTo(Endpoint[seda:errors]), RedeliveryPolicy[maximumRedeliveries=1]])] InOnly Properties:{} Headers:

      {camelFlatpackCounter=5} BodyType:net.sf.flatpack.DefaultDataSet
      4318172 [Thread: 2 org.apache.camel.component.file.FileComponent@14f5a31] INFO org.apache.camel.processor.interceptor.TraceInterceptor - ID-dell-charles/1671-1218196761734/1-7 -> to5 To[activemq:queue:cutas.clientA.accepted.in] InOnly Properties:{CamelCauseException=null} Headers:{camelFlatpackCounter=5}

      BodyType:net.sf.flatpack.DefaultDataSet
      4318219 [DefaultMessageListenerContainer-9] WARN org.apache.camel.component.jms.EndpointMessageListener - Endpoint[activemq:queue:cutas.clientA.accepted.in] consumer caught an exception while processing JMS message: ActiveMQMessage {commandId = 5, responseRequired = true, messageId = ID:dell-charles-1675-1218196762046-2:3:1:1:1, originalDestination = null, originalTransactionId = null, producerId = ID:dell-charles-1675-1218196762046-2:3:1:1, destination = queue://cutas.clientA.accepted.in, transactionId = null, expiration = 0, timestamp = 1218196771187, arrival = 0, brokerInTime = 1218196771187, brokerOutTime = 1218196771218, correlationId = null, replyTo = null, persistent = true, type = null, priority = 4, groupID = null, groupSequence = 0, targetConsumerId = null, compressed = false, userID = null, content = null, marshalledProperties = null, dataStructure = null, redeliveryCounter = 0, size = 1024, properties =

      {camelFlatpackCounter=0}

      , readOnlyProperties = true, readOnlyBody = true, droppable = false}
      43org.apache.camel.RuntimeCamelException: java.lang.NullPointerException
      at org.apache.camel.component.jms.EndpointMessageListener.onMessage(EndpointMessageListener.java:71)
      at org.springframework.jms.listener.AbstractMessageListenerContainer.doInvokeListener(AbstractMessageListenerContainer.java:531)
      at org.springframework.jms.listener.AbstractMessageListenerContainer.invokeListener(AbstractMessageListenerContainer.java:466)
      at org.springframework.jms.listener.AbstractMessageListenerContainer.doExecuteListener(AbstractMessageListenerContainer.java:435)
      at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.doReceiveAndExecute(AbstractPollingMessageListenerContainer.java:322)
      at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.receiveAndExecute(AbstractPollingMessageListenerContainer.java:260)
      at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.invokeListener(DefaultMessageListenerContainer.java:944)
      at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:875)
      at java.lang.Thread.run(Unknown Source)
      Caused by: java.lang.NullPointerException
      at org.apache.camel.processor.interceptor.TraceFormatter.getBodyTypeAsString(TraceFormatter.java:124)
      at org.apache.camel.processor.interceptor.TraceFormatter.format(TraceFormatter.java:39)
      at org.apache.camel.processor.interceptor.TraceInterceptor.format(TraceInterceptor.java:68)
      at org.apache.camel.processor.Logger.logMessage(Logger.java:218)
      at org.apache.camel.processor.Logger.process(Logger.java:125)
      at org.apache.camel.processor.interceptor.TraceInterceptor.logException(TraceInterceptor.java:128)
      at org.apache.camel.processor.interceptor.TraceInterceptor.process(TraceInterceptor.java:59)
      at org.apache.camel.impl.converter.AsyncProcessorTypeConverter$ProcessorToAsyncProcessorBridge.process(AsyncProcessorTypeConverter.java:43)
      at org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcessor.java:39)
      at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:41)
      at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:66)
      at org.apache.camel.component.jms.EndpointMessageListener.onMessage(EndpointMessageListener.java:68)
      ... 8 more

      Code snippet :

      public void configure() {

      errorHandler(deadLetterChannel("seda:errors").maximumRedeliveries(1)
      .useExponentialBackOff());

      // Display trace
      Tracer tracer = new Tracer();
      tracer.getFormatter().setShowBody(false);
      tracer.getFormatter().setShowHeaders(true);
      tracer.getFormatter().setShowNode(true);
      getContext().addInterceptStrategy(tracer);

      from(file:///c:/temp/cutas/input/clientA/?delete=false&lock=true&consumer.delay=500&consumer.initialDelay=10)
      .to(flatpack:fixed:com/bravura/babel/transformation/cutas/in/CUTAS.xml);

      from(flatpack:fixed:com/bravura/babel/transformation/cutas/in/CUTAS.xml)
      .to(activemq:queue:cutas.clientA.accepted.in);

      Attachments

        Activity

          People

            Unassigned Unassigned
            cmoulliard Moulliard Charles
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: