[ 
https://issues.apache.org/jira/browse/CAMEL-21730?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17928136#comment-17928136
 ] 

Claus Ibsen commented on CAMEL-21730:
-------------------------------------

You are not really expected to write prototypes where files are located in a 
old fashioned maven like structure with deep folders.

You would have the files in the same folder, and just do camel run *. And then 
export will put the files in to src/java src/resources accordingly.

Otherwise you would need to run/export with all the files and with those long 
folder names

camel export foo.java META-INF/resources/index.html

However the correct approach would be to have index.html in the same folder as 
the code/route and just do camel run *
After you export and if you desire to have those META-INF folder and what the 
.... then you move them manually to be more JEE / Maven like

> 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.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)

Reply via email to