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

NPE with Camel 2.10.0 and Bindy

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Abandoned
    • Affects Version/s: 2.10.0
    • Fix Version/s: 2.11.0
    • Component/s: camel-bindy
    • Labels:
      None
    • Environment:

      Windows 7, Java 1.6.0_31

    • Estimated Complexity:
      Unknown

      Description

      Running this route:

      from("direct:start").unmarshal().bindy(BindyType.Csv, services.billing.BillingItem.class).to("direct:middle");

      Where services.billing.BillingItem.class exists and has the following annotations:

      @CsvRecord(separator = ",", quote = "\"", skipFirstLine = true)
      public class BillingItem {
      ...

      It throws a NPE:

      java.lang.NullPointerException
      at org.apache.camel.dataformat.bindy.BindyAbstractFactory.initModel(BindyAbstractFactory.java:81)
      at org.apache.camel.dataformat.bindy.BindyAbstractFactory.<init>(BindyAbstractFactory.java:65)
      at org.apache.camel.dataformat.bindy.BindyCsvFactory.<init>(BindyCsvFactory.java:76)
      at org.apache.camel.dataformat.bindy.csv.BindyCsvDataFormat.createModelFactory(BindyCsvDataFormat.java:261)
      at org.apache.camel.dataformat.bindy.BindyAbstractDataFormat.getFactory(BindyAbstractDataFormat.java:69)
      at org.apache.camel.dataformat.bindy.csv.BindyCsvDataFormat.unmarshal(BindyCsvDataFormat.java:108)
      at org.apache.camel.processor.UnmarshalProcessor.process(UnmarshalProcessor.java:57)
      at org.apache.camel.util.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:61)
      at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)
      at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)
      at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
      at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:73)
      at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)
      at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)
      at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)
      at org.apache.camel.processor.interceptor.TraceInterceptor.process(TraceInterceptor.java:163)
      at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)
      at org.apache.camel.processor.RedeliveryErrorHandler.processErrorHandler(RedeliveryErrorHandler.java:330)
      at org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:220)

      When I change the code to:

      from("direct:start").unmarshal().bindy(BindyType.Csv, "services.billing").to("direct:middle");

      It works.

      Expected result: if this the incorrect way to use, it should return a readable message.

      Thanks.

        Attachments

          Activity

            People

            • Assignee:
              davsclaus Claus Ibsen
              Reporter:
              reynald Renato Weiner
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: