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

Pasquale Congiusti commented on CAMEL-21301:
--------------------------------------------

I am still working on backporting and testing against 4.8.1. It is needed to 
fix the regression over there.

> [camel-jbang] Error when running openapi contract first with Q or SB
> --------------------------------------------------------------------
>
>                 Key: CAMEL-21301
>                 URL: https://issues.apache.org/jira/browse/CAMEL-21301
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-jbang
>    Affects Versions: 4.8.0
>            Reporter: Pasquale Congiusti
>            Assignee: Pasquale Congiusti
>            Priority: Major
>             Fix For: 4.8.1, 4.9.0
>
>
> Camel Jbang version:
> {code}
> $ camel version
> JBang version: 0.119.0
> Camel JBang version: 4.8.0
> {code}
> Camel Main OK:
> {code}
> $ camel run petstore-v3.json petstore.camel.yaml --runtime main 
> --camel-version 4.8.0
> 2024-10-02 10:51:33.404  INFO 55540 --- [           main] 
> org.apache.camel.main.MainSupport        : Apache Camel (JBang) 4.8.0 is 
> starting
> 2024-10-02 10:51:33.453  INFO 55540 --- [           main] 
> org.apache.camel.main.MainSupport        : Additional files added to 
> classpath: petstore-v3.json
> 2024-10-02 10:51:33.586  INFO 55540 --- [           main] 
> org.apache.camel.main.MainSupport        : Using Java 17.0.7 with PID 55540. 
> Started by squake in /home/squake/Desktop/jbangdocker
> 2024-10-02 10:51:33.767  INFO 55540 --- [           main] 
> org.apache.camel.main.ProfileConfigurer  : The application is starting with 
> profile: dev
> 2024-10-02 10:51:34.131  INFO 55540 --- [           main] 
> he.camel.cli.connector.LocalCliConnector : Camel JBang CLI enabled
> 2024-10-02 10:51:35.408  INFO 55540 --- [           main] 
> e.camel.impl.engine.AbstractCamelContext : Apache Camel 4.8.0 (petstore) is 
> starting
> ...
> 2024-10-02 10:51:36.290  INFO 55540 --- [           main] 
> ponent.platform.http.main.MainHttpServer :     
> http://0.0.0.0:8080/api/v3/user/{username}            (DELETE,GET,PUT) 
> (accept:application/json,application/x-www-form-urlencoded,application/xml 
> produce:application/json,application/xml)
> {code}
> Camel Quarkus KO:
> {code}
> $ camel run petstore-v3.json petstore.camel.yaml --runtime quarkus 
> --camel-version 4.8.0
> Running using Quarkus v3.14.2 (preparing and downloading files)
> Executing "/usr/lib/jvm/java-17-openjdk/bin/java 
> -Dquarkus.platform.version=3.14.2 -Dquarkus.application.version=1.0-SNAPSHOT 
> -Dquarkus.platform.artifact-id=quarkus-bom 
> -Dquarkus.platform.group-id=io.quarkus.platform 
> -Dquarkus.application.name=jbang-run-dummy -jar 
> /home/squake/Desktop/jbangdocker/.camel-jbang-run/1727859109234/target/quarkus-app/quarkus-run.jar"
> __  ____  __  _____   ___  __ ____  ______ 
>  --/ __ \/ / / / _ | / _ \/ //_/ / / / __/ 
>  -/ /_/ / /_/ / __ |/ , _/ ,< / /_/ /\ \   
> --\___\_\____/_/ |_/_/|_/_/|_|\____/___/   
> 2024-10-02 10:52:03,449 INFO  [org.apa.cam.qua.cor.CamelBootstrapRecorder] 
> (main) Apache Camel Quarkus 3.14.0 is starting
> 2024-10-02 10:52:03,455 INFO  [org.apa.cam.mai.MainSupport] (main) Apache 
> Camel (Main) 4.7.0 is starting
> 2024-10-02 10:52:03,525 INFO  [org.apa.cam.mai.BaseMainSupport] (main) 
> Auto-configuration summary
> 2024-10-02 10:52:03,525 INFO  [org.apa.cam.mai.BaseMainSupport] (main)     
> [MicroProfilePropertiesSource] 
> camel.main.routesIncludePattern=camel/petstore.camel.yaml
> 2024-10-02 10:52:03,586 INFO  [org.apa.cam.cli.con.LocalCliConnector] (main) 
> Camel JBang CLI enabled
> 2024-10-02 10:52:03,958 INFO  [org.apa.cam.imp.eng.AbstractCamelContext] 
> (main) Apache Camel 4.7.0 (camel-1) is starting
> 2024-10-02 10:52:04,355 ERROR [org.apa.cam.imp.eng.AbstractCamelContext] 
> (main) Error starting CamelContext (camel-1) due to exception thrown: OpenAPI 
> specification has 19 unmapped operations to corresponding routes: 
>       direct:addPet
>       direct:createUser
>       direct:createUsersWithListInput
>       direct:deleteOrder
>       direct:deletePet
>       direct:deleteUser
>       direct:findPetsByStatus
>       direct:findPetsByTags
>       direct:getInventory
>       direct:getOrderById
>       direct:getPetById
>       direct:getUserByName
>       direct:loginUser
>       direct:logoutUser
>       direct:placeOrder
>       direct:updatePet
>       direct:updatePetWithForm
>       direct:updateUser
>       direct:uploadFile: java.lang.IllegalArgumentException: OpenAPI 
> specification has 19 unmapped operations to corresponding routes: 
>       direct:addPet
>       direct:createUser
>       direct:createUsersWithListInput
>       direct:deleteOrder
>       direct:deletePet
>       direct:deleteUser
>       direct:findPetsByStatus
>       direct:findPetsByTags
>       direct:getInventory
>       direct:getOrderById
>       direct:getPetById
>       direct:getUserByName
>       direct:loginUser
>       direct:logoutUser
>       direct:placeOrder
>       direct:updatePet
>       direct:updatePetWithForm
>       direct:updateUser
>       direct:uploadFile
>       at 
> org.apache.camel.component.rest.openapi.DefaultRestOpenapiProcessorStrategy.validateOpenApi(DefaultRestOpenapiProcessorStrategy.java:103)
>       at 
> org.apache.camel.component.rest.openapi.RestOpenApiProcessor.doInit(RestOpenApiProcessor.java:206)
>       at 
> org.apache.camel.support.service.BaseService.init(BaseService.java:78)
>       at 
> org.apache.camel.support.service.ServiceHelper.initService(ServiceHelper.java:84)
>       at 
> org.apache.camel.support.service.ServiceHelper.initService(ServiceHelper.java:101)
>       at 
> org.apache.camel.support.DefaultConsumer.doInit(DefaultConsumer.java:223)
>       at 
> org.apache.camel.component.platform.http.DefaultPlatformHttpConsumer.doInit(DefaultPlatformHttpConsumer.java:69)
>       at 
> org.apache.camel.support.service.BaseService.init(BaseService.java:78)
>       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:3170)
>       at 
> org.apache.camel.impl.engine.InternalRouteStartupManager.doStartOrResumeRouteConsumers(InternalRouteStartupManager.java:415)
>       at 
> org.apache.camel.impl.engine.InternalRouteStartupManager.doStartRouteConsumers(InternalRouteStartupManager.java:331)
>       at 
> org.apache.camel.impl.engine.InternalRouteStartupManager.safelyStartRouteServices(InternalRouteStartupManager.java:217)
>       at 
> org.apache.camel.impl.engine.InternalRouteStartupManager.doStartOrResumeRoutes(InternalRouteStartupManager.java:129)
>       at 
> org.apache.camel.impl.engine.AbstractCamelContext.doStartCamel(AbstractCamelContext.java:2855)
>       at 
> org.apache.camel.impl.engine.AbstractCamelContext.doStartContext(AbstractCamelContext.java:2485)
>       at 
> org.apache.camel.impl.engine.AbstractCamelContext.doStart(AbstractCamelContext.java:2440)
>       at 
> org.apache.camel.support.service.BaseService.start(BaseService.java:113)
>       at 
> org.apache.camel.impl.engine.AbstractCamelContext.start(AbstractCamelContext.java:2043)
>       at 
> org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:211)
>       at org.apache.camel.quarkus.main.CamelMain.doStart(CamelMain.java:91)
>       at 
> org.apache.camel.support.service.BaseService.start(BaseService.java:113)
>       at 
> org.apache.camel.quarkus.main.CamelMain.startEngine(CamelMain.java:137)
>       at 
> org.apache.camel.quarkus.main.CamelMainRuntime.start(CamelMainRuntime.java:49)
>       at 
> org.apache.camel.quarkus.core.CamelBootstrapRecorder.start(CamelBootstrapRecorder.java:45)
>       at 
> io.quarkus.deployment.steps.CamelBootstrapProcessor$boot173480958.deploy_0(Unknown
>  Source)
>       at 
> io.quarkus.deployment.steps.CamelBootstrapProcessor$boot173480958.deploy(Unknown
>  Source)
>       at io.quarkus.runner.ApplicationImpl.doStart(Unknown Source)
>       at io.quarkus.runtime.Application.start(Application.java:101)
>       at 
> io.quarkus.runtime.ApplicationLifecycleManager.run(ApplicationLifecycleManager.java:119)
>       at io.quarkus.runtime.Quarkus.run(Quarkus.java:71)
>       at io.quarkus.runtime.Quarkus.run(Quarkus.java:44)
>       at io.quarkus.runtime.Quarkus.run(Quarkus.java:124)
>       at io.quarkus.runner.GeneratedMain.main(Unknown Source)
>       at 
> java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>       at 
> java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
>       at 
> java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>       at java.base/java.lang.reflect.Method.invoke(Method.java:568)
>       at 
> io.quarkus.bootstrap.runner.QuarkusEntryPoint.doRun(QuarkusEntryPoint.java:62)
>       at 
> io.quarkus.bootstrap.runner.QuarkusEntryPoint.main(QuarkusEntryPoint.java:33)
> {code}
> Camel Spring Boot KO:
> {code}
> $ camel run petstore-v3.json petstore.camel.yaml --runtime spring-boot
> Running using Spring Boot v3.3.3 (preparing and downloading files)
> ...
> 2024-10-02T10:51:20.359+02:00  INFO 55262 --- [           main] 
> o.e.p.jbangrundummy.CamelApplication     : Starting CamelApplication using 
> Java 17.0.7 with PID 55262 
> (/home/squake/Desktop/jbangdocker/.camel-jbang-run/1727859072730/target/classes
>  started by squake in 
> /home/squake/Desktop/jbangdocker/.camel-jbang-run/1727859072730)
> 2024-10-02T10:51:20.361+02:00  INFO 55262 --- [           main] 
> o.e.p.jbangrundummy.CamelApplication     : No active profile set, falling 
> back to 1 default profile: "default"
> 2024-10-02T10:51:21.252+02:00  INFO 55262 --- [           main] 
> o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat initialized with port 8080 
> (http)
> 2024-10-02T10:51:21.261+02:00  INFO 55262 --- [           main] 
> o.apache.catalina.core.StandardService   : Starting service [Tomcat]
> 2024-10-02T10:51:21.261+02:00  INFO 55262 --- [           main] 
> o.apache.catalina.core.StandardEngine    : Starting Servlet engine: [Apache 
> Tomcat/10.1.28]
> 2024-10-02T10:51:21.309+02:00  INFO 55262 --- [           main] 
> o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring embedded 
> WebApplicationContext
> 2024-10-02T10:51:21.309+02:00  INFO 55262 --- [           main] 
> w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: 
> initialization completed in 919 ms
> 2024-10-02T10:51:21.758+02:00  INFO 55262 --- [           main] 
> o.a.c.cli.connector.LocalCliConnector    : Camel JBang CLI enabled
> 2024-10-02T10:51:22.042+02:00  INFO 55262 --- [           main] 
> o.s.b.a.e.web.EndpointLinksResolver      : Exposing 1 endpoint beneath base 
> path '/actuator'
> 2024-10-02T10:51:22.109+02:00  INFO 55262 --- [           main] 
> o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat started on port 8080 (http) 
> with context path '/'
> 2024-10-02T10:51:22.285+02:00  INFO 55262 --- [           main] 
> o.a.c.s.o.OpenApiAutoConfiguration       : OpenAPI (3.0.2) created from Camel 
> Rest-DSL
> 2024-10-02T10:51:22.475+02:00  INFO 55262 --- [           main] 
> o.a.c.impl.engine.AbstractCamelContext   : Apache Camel 4.8.0 (camel-1) is 
> starting
> 2024-10-02T10:51:22.531+02:00 ERROR 55262 --- [           main] 
> o.a.c.impl.engine.AbstractCamelContext   : Error starting CamelContext 
> (camel-1) due to exception thrown: Failed to start component platform-http 
> because of PlatformHttpEngine is neither set on this endpoint neither found 
> in Camel Registry or FactoryFinder.
> org.apache.camel.FailedToStartComponentException: Failed to start component 
> platform-http because of PlatformHttpEngine is neither set on this endpoint 
> neither found in Camel Registry or FactoryFinder.
>       at 
> org.apache.camel.impl.engine.AbstractCamelContext.doStartCamel(AbstractCamelContext.java:2798)
>       at 
> org.apache.camel.impl.engine.AbstractCamelContext.doStartContext(AbstractCamelContext.java:2524)
>       at 
> org.apache.camel.impl.engine.AbstractCamelContext.doStart(AbstractCamelContext.java:2479)
>       at 
> org.apache.camel.spring.boot.SpringBootCamelContext.doStart(SpringBootCamelContext.java:43)
>       at 
> org.apache.camel.support.service.BaseService.start(BaseService.java:123)
>       at 
> org.apache.camel.impl.engine.AbstractCamelContext.start(AbstractCamelContext.java:2083)
>       at 
> org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:211)
>       at 
> org.apache.camel.spring.SpringCamelContext.start(SpringCamelContext.java:121)
>       at 
> org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringCamelContext.java:153)
>       at 
> org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:185)
>       at 
> org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:178)
>       at 
> org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:156)
>       at 
> org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:452)
>       at 
> org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:385)
>       at 
> org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:993)
>       at 
> org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:628)
>       at 
> org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:146)
>       at 
> org.springframework.boot.SpringApplication.refresh(SpringApplication.java:754)
>       at 
> org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:456)
>       at 
> org.springframework.boot.SpringApplication.run(SpringApplication.java:335)
>       at 
> org.springframework.boot.SpringApplication.run(SpringApplication.java:1363)
>       at 
> org.springframework.boot.SpringApplication.run(SpringApplication.java:1352)
>       at 
> org.example.project.jbangrundummy.CamelApplication.main(CamelApplication.java:10)
> Caused by: java.lang.IllegalStateException: PlatformHttpEngine is neither set 
> on this endpoint neither found in Camel Registry or FactoryFinder.
>       at 
> org.apache.camel.component.platform.http.PlatformHttpComponent.lambda$getOrCreateEngine$2(PlatformHttpComponent.java:276)
>       at java.base/java.util.Optional.orElseThrow(Optional.java:403)
>       at 
> org.apache.camel.component.platform.http.PlatformHttpComponent.getOrCreateEngine(PlatformHttpComponent.java:276)
>       at 
> org.apache.camel.component.platform.http.PlatformHttpComponent.doStart(PlatformHttpComponent.java:173)
>       at 
> org.apache.camel.support.service.BaseService.start(BaseService.java:123)
>       at 
> org.apache.camel.support.service.ServiceHelper.startService(ServiceHelper.java:126)
>       at 
> org.apache.camel.impl.engine.AbstractCamelContext.startService(AbstractCamelContext.java:3208)
>       at 
> org.apache.camel.impl.engine.AbstractCamelContext.doStartCamel(AbstractCamelContext.java:2796)
>       ... 22 common frames omitted
> 2024-10-02T10:51:22.534+02:00  WARN 55262 --- [           main] 
> o.a.c.s.boot.SpringBootCamelContext      : CamelContext has only been running 
> for less than a second. If you intend to run Camel for a longer time then you 
> can set the property camel.springboot.main-run-controller=true in 
> application.properties or add spring-boot-starter-web JAR to the classpath.
> {code}



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

Reply via email to