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

camel-jbang - Using camel run --source-dir component should be able to load from classpath

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 4.4.0
    • camel-jbang
    • None
    • Unknown

    Description

      It could be that the --source-dir should be set as the root classpath.

          from:
            id: from-972f
            description: Scheduler
            uri: sql
            parameters:
              query: classpath://db-scheduler.sql
      

      It works fine when I run it
      jbang camel@apache/camel run *
      however when I run it with
      jbang camel@apache/camel run --source-dir=.

      org.apache.camel.RuntimeCamelException: java.io.FileNotFoundException: Cannot find resource: classpath:/db-scheduler.sql for URI: classpath://db-scheduler.sql
              at org.apache.camel.RuntimeCamelException.wrapRuntimeException(RuntimeCamelException.java:66)
              at org.apache.camel.support.service.BaseService.doFail(BaseService.java:407)
              at org.apache.camel.support.service.BaseService.fail(BaseService.java:336)
              at org.apache.camel.support.service.BaseService.init(BaseService.java:82)
              at org.apache.camel.support.service.BaseService.start(BaseService.java:105)
              at org.apache.camel.support.service.ServiceHelper.startService(ServiceHelper.java:126)
              at org.apache.camel.impl.engine.AbstractCamelContext.startService(AbstractCamelContext.java:3054)
              at org.apache.camel.impl.engine.InternalRouteStartupManager.doStartOrResumeRouteConsumers(InternalRouteStartupManager.java:408)
              at org.apache.camel.impl.engine.InternalRouteStartupManager.doStartRouteConsumers(InternalRouteStartupManager.java:325)
              at org.apache.camel.impl.engine.InternalRouteStartupManager.safelyStartRouteServices(InternalRouteStartupManager.java:211)
              at org.apache.camel.impl.engine.InternalRouteStartupManager.doStartOrResumeRoutes(InternalRouteStartupManager.java:144)
              at org.apache.camel.impl.engine.AbstractCamelContext.doStartCamel(AbstractCamelContext.java:2778)
              at org.apache.camel.impl.engine.AbstractCamelContext.doStartContext(AbstractCamelContext.java:2459)
              at org.apache.camel.impl.engine.AbstractCamelContext.doStart(AbstractCamelContext.java:2414)
              at org.apache.camel.support.service.BaseService.start(BaseService.java:113)
              at org.apache.camel.impl.engine.AbstractCamelContext.start(AbstractCamelContext.java:2019)
              at org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:208)
              at org.apache.camel.main.KameletMain.doStart(KameletMain.java:323)
              at org.apache.camel.support.service.BaseService.start(BaseService.java:113)
              at org.apache.camel.dsl.jbang.core.commands.Run.runKameletMain(Run.java:1059)
              at org.apache.camel.dsl.jbang.core.commands.Run.run(Run.java:781)
              at org.apache.camel.dsl.jbang.core.commands.Run.doCall(Run.java:290)
              at org.apache.camel.dsl.jbang.core.commands.CamelCommand.call(CamelCommand.java:71)
              at org.apache.camel.dsl.jbang.core.commands.CamelCommand.call(CamelCommand.java:36)
              at picocli.CommandLine.executeUserObject(CommandLine.java:2041)
              at picocli.CommandLine.access$1500(CommandLine.java:148)
              at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2461)
              at picocli.CommandLine$RunLast.handle(CommandLine.java:2453)
              at picocli.CommandLine$RunLast.handle(CommandLine.java:2415)
              at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2273)
              at picocli.CommandLine$RunLast.execute(CommandLine.java:2417)
              at picocli.CommandLine.execute(CommandLine.java:2170)
              at org.apache.camel.dsl.jbang.core.commands.CamelJBangMain.run(CamelJBangMain.java:172)
              at main.CamelJBang.main(CamelJBang.java:36)
      Caused by: java.io.FileNotFoundException: Cannot find resource: classpath:/db-scheduler.sql for URI: classpath://db-scheduler.sql
              at org.apache.camel.support.ResourceHelper.resolveMandatoryResourceAsInputStream(ResourceHelper.java:114)
              at org.apache.camel.component.sql.SqlHelper.resolveQuery(SqlHelper.java:39)
              at org.apache.camel.component.sql.SqlConsumer.doInit(SqlConsumer.java:112)
              at org.apache.camel.support.service.BaseService.init(BaseService.java:78)
      

      Attachments

        Activity

          People

            davsclaus Claus Ibsen
            davsclaus Claus Ibsen
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: