You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Claus Ibsen (Jira)" <ji...@apache.org> on 2025/02/19 11:33:00 UTC

[jira] [Resolved] (CAMEL-21730) JBang export cannot validate route that depends on copied resources

     [ https://issues.apache.org/jira/browse/CAMEL-21730?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Claus Ibsen resolved CAMEL-21730.
---------------------------------
    Resolution: Fixed

> JBang export cannot validate route that depends on copied resources
> -------------------------------------------------------------------
>
>                 Key: CAMEL-21730
>                 URL: https://issues.apache.org/jira/browse/CAMEL-21730
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-jbang
>            Reporter: Thomas Diesler
>            Assignee: Thomas Diesler
>            Priority: Minor
>             Fix For: 4.8.4, 4.10.1, 4.11.0
>
>
> With a route like this ...
> {code}
> - route:
>     from:
>       uri: "platform-http:/"
>       steps:
>         - setBody:
>             simple: "resource:classpath:META-INF/resources/index.html"
> {code}
> on export I get ...
> {code}
> org.apache.camel.FailedToCreateRouteException: Failed to create route route1 at: >>> SetBody[simple{resource:classpath:META-INF/resources/index.html}] <<< in route: Route(route1)[From[platform-http:/] -> [SetBody[simple{resou... because of Illegal syntax: resource:classpath:META-INF/resources/index.html
> 	at org.apache.camel.reifier.RouteReifier.doCreateRoute(RouteReifier.java:235)
> 	at org.apache.camel.reifier.RouteReifier.createRoute(RouteReifier.java:86)
> 	at org.apache.camel.impl.DefaultModelReifierFactory.createRoute(DefaultModelReifierFactory.java:49)
> 	at org.apache.camel.impl.DefaultCamelContext.startRouteDefinitions(DefaultCamelContext.java:736)
> 	at org.apache.camel.impl.DefaultCamelContext.startRouteDefinitions(DefaultCamelContext.java:597)
> 	at org.apache.camel.impl.engine.AbstractCamelContext.doInit(AbstractCamelContext.java:2457)
> 	at org.apache.camel.support.service.BaseService.init(BaseService.java:85)
> 	at org.apache.camel.impl.engine.AbstractCamelContext.init(AbstractCamelContext.java:2087)
> 	at org.apache.camel.support.service.BaseService.start(BaseService.java:115)
> 	at org.apache.camel.impl.engine.AbstractCamelContext.start(AbstractCamelContext.java:2106)
> 	at org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:211)
> 	at org.apache.camel.main.KameletMain.doStart(KameletMain.java:384)
> 	at org.apache.camel.support.service.BaseService.start(BaseService.java:123)
> 	at org.apache.camel.dsl.jbang.core.commands.Run.runKameletMain(Run.java:1447)
> 	at org.apache.camel.dsl.jbang.core.commands.Run.run(Run.java:908)
> 	at org.apache.camel.dsl.jbang.core.commands.Run.runExport(Run.java:352)
> 	at org.apache.camel.dsl.jbang.core.commands.ExportBaseCommand.runSilently(ExportBaseCommand.java:344)
> 	at org.apache.camel.dsl.jbang.core.commands.ExportCamelMain.export(ExportCamelMain.java:66)
> {code}
> The issue seems to be that export is calling KameletMain.doStart() by which the referenced resources have not been copied.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)