apache / camel-karavan

Apache Camel Karavan a Low-code Data Integration Platform
https://camel.apache.org
Apache License 2.0
452 stars 156 forks source link

Cannot find RoutesBuilderLoader in classpath supporting file extension: kamelet.yaml.kamelet.yaml #1390

Closed enter-marlah closed 2 months ago

enter-marlah commented 2 months ago

Describe the bug

I made a kamelet with a file name custom-logger-action.kamelet.yaml with Title custom-logger-action in the Karavan UI.

The Kamelet works fine in dev mode but when I try to build the project, I get error:

java.lang.IllegalArgumentException: Cannot find RoutesBuilderLoader in classpath supporting file extension: kamelet.yaml.kamelet.yaml

Any ideas?

Steps to reproduce the behavior

  1. Go to '...'a
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Variant

Web Application

Container Management (if applicable)

Kubernetes

Operating System (if applicable)

Linux

Version

4.6.0

Relevant log output

Cloning into '/karavan/code'...
org.apache.camel.RuntimeCamelException: org.apache.camel.VetoCamelContextStartException: Failure creating route from template: custom-logger-action.kamelet.yaml
    at org.apache.camel.RuntimeCamelException.wrapRuntimeException(RuntimeCamelException.java:66)
    at org.apache.camel.support.service.BaseService.doFail(BaseService.java:407)
    at org.apache.camel.impl.engine.AbstractCamelContext.doFail(AbstractCamelContext.java:3047)
    at org.apache.camel.support.service.BaseService.fail(BaseService.java:336)
    at org.apache.camel.impl.engine.AbstractCamelContext.failOnStartup(AbstractCamelContext.java:3937)
    at org.apache.camel.impl.engine.AbstractCamelContext.init(AbstractCamelContext.java:2040)
    at org.apache.camel.support.service.BaseService.start(BaseService.java:105)
    at org.apache.camel.impl.engine.AbstractCamelContext.start(AbstractCamelContext.java:2046)
    at org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:212)
    at org.apache.camel.main.KameletMain.doStart(KameletMain.java:364)
    at org.apache.camel.support.service.BaseService.start(BaseService.java:113)
    at org.apache.camel.dsl.jbang.core.commands.Run.runKameletMain(Run.java:1299)
    at org.apache.camel.dsl.jbang.core.commands.Run.run(Run.java:844)
    at org.apache.camel.dsl.jbang.core.commands.Run.runSilent(Run.java:325)
    at org.apache.camel.dsl.jbang.core.commands.ExportBaseCommand.runSilently(ExportBaseCommand.java:299)
    at org.apache.camel.dsl.jbang.core.commands.ExportCamelMain.export(ExportCamelMain.java:67)
    at org.apache.camel.dsl.jbang.core.commands.Export.export(Export.java:138)
    at org.apache.camel.dsl.jbang.core.commands.Export.export(Export.java:59)
    at org.apache.camel.dsl.jbang.core.commands.ExportBaseCommand.doCall(ExportBaseCommand.java:239)
    at org.apache.camel.dsl.jbang.core.commands.Export.doCall(Export.java:28)
    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:37)
    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:165)
    at org.apache.camel.dsl.jbang.core.commands.CamelJBangMain.run(CamelJBangMain.java:61)
    at main.CamelJBang.main(CamelJBang.java:36)
Caused by: org.apache.camel.VetoCamelContextStartException: Failure creating route from template: custom-logger-action.kamelet.yaml
    at org.apache.camel.component.kamelet.KameletComponent$LifecycleHandler.onContextInitialized(KameletComponent.java:456)
    at org.apache.camel.impl.engine.AbstractCamelContext.doInit(AbstractCamelContext.java:2401)
    at org.apache.camel.support.service.BaseService.init(BaseService.java:78)
    at org.apache.camel.impl.engine.AbstractCamelContext.init(AbstractCamelContext.java:2027)
    ... 27 more
Caused by: java.lang.IllegalArgumentException: Cannot find RoutesBuilderLoader in classpath supporting file extension: kamelet.yaml.kamelet.yaml
    at org.apache.camel.impl.engine.DefaultRoutesLoader.resolveRoutesBuilderLoader(DefaultRoutesLoader.java:314)
    at org.apache.camel.impl.engine.DefaultRoutesLoader.findRoutesBuilders(DefaultRoutesLoader.java:124)
    at org.apache.camel.impl.engine.DefaultRoutesLoader.findRoutesBuilders(DefaultRoutesLoader.java:101)
    at org.apache.camel.spi.RoutesLoader.findRoutesBuilders(RoutesLoader.java:133)
    at org.apache.camel.spi.RoutesLoader.loadRoutes(RoutesLoader.java:85)
    at org.apache.camel.support.RouteTemplateHelper.loadRouteTemplateFromLocation(RouteTemplateHelper.java:105)
    at org.apache.camel.component.kamelet.KameletComponent$LifecycleHandler.createRouteForEndpoint(KameletComponent.java:426)
    at org.apache.camel.component.kamelet.KameletComponent$LifecycleHandler.onContextInitialized(KameletComponent.java:453)
    ... 30 more
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  0.068 s
[INFO] Finished at: 2024-08-30T11:06:03Z
[INFO] ------------------------------------------------------------------------
[ERROR] The goal you specified requires a project to execute but there is no POM in this directory (/karavan/code/koekoe). Please verify you invoked Maven from the correct directory. -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MissingProjectException
mgubaidullin commented 2 months ago

Can you try with 4.7.0

t33muki commented 2 months ago

Hi, I'm working in the same team as enter-marlah. Unfortunately we can't use the 4.7.0 as the git branch functionality is broken.

https://github.com/apache/camel-karavan/issues/1347

t33muki commented 2 months ago

4.7.1 seems to work. Problem was that earlier version appended 'kamelet.yaml' into custom kamelets name and this resulted in duplicate 'kamelet.yaml.kamelet.yaml' file extension.

I think this can be closed.