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

LevelDB NPE if persistentFileName has no paths in LevelDBAggregationRepository

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.22.3, 2.23.1
    • 2.23.2, 2.24.0, 2.22.4, 3.0.0
    • camel-leveldb
    • MacOS 10.14.3

      java version "1.8.0_201"
      Java(TM) SE Runtime Environment (build 1.8.0_201-b09)
      Java HotSpot(TM) 64-Bit Server VM (build 25.201-b09, mixed mode)

    • Novice

    Description

      If the constructor of

      LevelDBAggregationRepository("repositoryName", "persistentFilename")

      is used and the

      fileName

      does not include any path delimiters it will return a NPE.

       

      The actual NPE code is within LevelDBFile.java where the getFile().getParent() is the cause:

      try {
       getFile().getParentFile().mkdirs();
       DBFactory factory = getFactory();
       db = factory.open(getFile(), options);
      } catch (IOException ioe) {
       throw new RuntimeException("Error opening LevelDB with file " + getFile(), ioe);
      }

       

      Stacktrace:

      Caused by: java.lang.NullPointerException: null
      at org.apache.camel.component.leveldb.LevelDBFile.start(LevelDBFile.java:173)
      at org.apache.camel.util.ServiceHelper.startService(ServiceHelper.java:75)
      at org.apache.camel.component.leveldb.LevelDBAggregationRepository.doStart(LevelDBAggregationRepository.java:412)
      at org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:72)
      at org.apache.camel.util.ServiceHelper.startService(ServiceHelper.java:75)
      at org.apache.camel.util.ServiceHelper.startService(ServiceHelper.java:60)
      at org.apache.camel.util.ServiceHelper.startServices(ServiceHelper.java:104)
      at org.apache.camel.util.ServiceHelper.startServices(ServiceHelper.java:90)
      at org.apache.camel.processor.aggregate.AggregateProcessor.doStart(AggregateProcessor.java:1384)
      at org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:72)
      at org.apache.camel.util.ServiceHelper.startService(ServiceHelper.java:75)
      at org.apache.camel.util.ServiceHelper.startService(ServiceHelper.java:60)
      at org.apache.camel.util.ServiceHelper.startServices(ServiceHelper.java:104)
      at org.apache.camel.util.ServiceHelper.startServices(ServiceHelper.java:90)
      at org.apache.camel.processor.RedeliveryErrorHandler.doStart(RedeliveryErrorHandler.java:1484)
      at org.apache.camel.support.ChildServiceSupport.start(ChildServiceSupport.java:44)
      at org.apache.camel.support.ChildServiceSupport.start(ChildServiceSupport.java:31)
      at org.apache.camel.util.ServiceHelper.startService(ServiceHelper.java:75)
      at org.apache.camel.util.ServiceHelper.startService(ServiceHelper.java:60)
      at org.apache.camel.util.ServiceHelper.startServices(ServiceHelper.java:104)
      at org.apache.camel.util.ServiceHelper.startServices(ServiceHelper.java:90)
      at org.apache.camel.processor.interceptor.DefaultChannel.doStart(DefaultChannel.java:160)
      at org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:72)
      at org.apache.camel.util.ServiceHelper.startService(ServiceHelper.java:75)
      at org.apache.camel.util.ServiceHelper.startService(ServiceHelper.java:60)
      at org.apache.camel.util.ServiceHelper.startServices(ServiceHelper.java:104)
      at org.apache.camel.util.ServiceHelper.startServices(ServiceHelper.java:90)
      at org.apache.camel.processor.DelegateAsyncProcessor.doStart(DelegateAsyncProcessor.java:80)
      at org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:72)
      at org.apache.camel.util.ServiceHelper.startService(ServiceHelper.java:75)
      at org.apache.camel.impl.RouteService.startChildService(RouteService.java:370)
      at org.apache.camel.impl.RouteService.doWarmUp(RouteService.java:196)
      at org.apache.camel.impl.RouteService.warmUp(RouteService.java:145)
      ... 31 common frames omitted

      Attachments

        Activity

          People

            acosentino Andrea Cosentino
            hakuseki Mikael Andersson Wigander
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: