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

Error in loading routes based on kemelets without dependencies

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 3.14.0
    • None
    • camel-kamelet
    • None
    • Unknown

    Description

      Due to https://github.com/apache/camel/blob/main/dsl/camel-kamelet-main/src/main/java/org/apache/camel/main/KameletYamlRoutes.java#L66 loading a route that use a kamelet with a definition missing the dependencies node result in:

      16:30:03.333 [main] WARN  org.apache.camel.support.RouteTemplateHelper - RouteTemplateLoaderListener error due to null. This exception is ignored
      java.lang.NullPointerException: null
              at org.apache.camel.main.KameletDependencyDownloader.builder(KameletDependencyDownloader.java:73) ~[camel-kamelet-main-3.13.0.jar:3.13.0]
              at java.util.Optional.map(Optional.java:265) ~[?:?]
              at org.apache.camel.dsl.yaml.YamlRoutesBuilderLoaderSupport.doLoadRouteBuilder(YamlRoutesBuilderLoaderSupport.java:119) ~[camel-yaml-dsl-3.13.0.jar:3.13.0]
              at org.apache.camel.main.DependencyDownloader.loadRouteTemplate(DependencyDownloader.java:74) ~[camel-kamelet-main-3.13.0.jar:3.13.0]
              at org.apache.camel.support.RouteTemplateHelper.loadRouteTemplateFromLocation(RouteTemplateHelper.java:75) [camel-support-3.13.0.jar:3.13.0]
              at org.apache.camel.component.kamelet.KameletComponent$LifecycleHandler.createRouteForEndpoint(KameletComponent.java:395) [camel-kamelet-3.13.0.jar:3.13.0]
              at org.apache.camel.component.kamelet.KameletComponent$LifecycleHandler.onContextInitialized(KameletComponent.java:419) [camel-kamelet-3.13.0.jar:3.13.0]
              at org.apache.camel.impl.engine.AbstractCamelContext.doInit(AbstractCamelContext.java:2782) [camel-base-engine-3.13.0.jar:3.13.0]
              at org.apache.camel.support.service.BaseService.init(BaseService.java:83) [camel-api-3.13.0.jar:3.13.0]
              at org.apache.camel.impl.engine.AbstractCamelContext.init(AbstractCamelContext.java:2491) [camel-base-engine-3.13.0.jar:3.13.0]
              at org.apache.camel.support.service.BaseService.start(BaseService.java:111) [camel-api-3.13.0.jar:3.13.0]
              at org.apache.camel.impl.engine.AbstractCamelContext.start(AbstractCamelContext.java:2510) [camel-base-engine-3.13.0.jar:3.13.0]
              at org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:246) [camel-core-engine-3.13.0.jar:3.13.0]
              at org.apache.camel.main.KameletMain.doStart(KameletMain.java:114) [camel-kamelet-main-3.13.0.jar:3.13.0]
              at org.apache.camel.support.service.BaseService.start(BaseService.java:119) [camel-api-3.13.0.jar:3.13.0]
              at org.apache.camel.dsl.jbang.core.commands.Run.run(Run.java:114) [camel-jbang-core-3.13.0.jar:3.13.0]
              at org.apache.camel.dsl.jbang.core.commands.Run.call(Run.java:73) [camel-jbang-core-3.13.0.jar:3.13.0]
              at org.apache.camel.dsl.jbang.core.commands.Run.call(Run.java:32) [camel-jbang-core-3.13.0.jar:3.13.0]
              at picocli.CommandLine.executeUserObject(CommandLine.java:1953) [picocli-4.6.1.jar:task ':jar' property 'archiveVersion']
              at picocli.CommandLine.access$1300(CommandLine.java:145) [picocli-4.6.1.jar:task ':jar' property 'archiveVersion']
              at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2352) [picocli-4.6.1.jar:task ':jar' property 'archiveVersion']
              at picocli.CommandLine$RunLast.handle(CommandLine.java:2346) [picocli-4.6.1.jar:task ':jar' property 'archiveVersion']
              at picocli.CommandLine$RunLast.handle(CommandLine.java:2311) [picocli-4.6.1.jar:task ':jar' property 'archiveVersion']
              at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2179) [picocli-4.6.1.jar:task ':jar' property 'archiveVersion']
              at picocli.CommandLine.execute(CommandLine.java:2078) [picocli-4.6.1.jar:task ':jar' property 'archiveVersion']
              at org.apache.camel.dsl.jbang.core.commands.CamelJBangMain.run(CamelJBangMain.java:42) [camel-jbang-core-3.13.0.jar:3.13.0]
              at main.CamelJBang.main(CamelJBang.java:31) [CamelJBang.java.ea2625e92f4cfea74994bfc9f1dade92ef318ac991154411fa7cf3486bd54aff.jar:?]
      

      well it is just a warning but could be avoided with a check for `null`

      Attachments

        Issue Links

          Activity

            People

              valdar Andrea Tarocchi
              valdar Andrea Tarocchi
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: