Details
-
Improvement
-
Status: Resolved
-
Minor
-
Resolution: Fixed
-
4.6.0
-
None
-
Unknown
Description
When a Camel route uses a Kamelet but misses a mandatory field for some reason the error message is quite misleading. The error reports a "KameletNotFoundException" in the StackTrace which is misleading because the real error is an "IllegalArgumentException" due to the missing mandatory field.
Caused by: org.apache.camel.VetoCamelContextStartException: Failure creating route from template: set-body-action at org.apache.camel.component.kamelet.KameletComponent$LifecycleHandler.onContextInitialized(KameletComponent.java:451) at org.apache.camel.impl.engine.AbstractCamelContext.doInit(AbstractCamelContext.java:2395) at org.apache.camel.quarkus.core.FastCamelContext.doInit(FastCamelContext.java:194) at org.apache.camel.support.service.BaseService.init(BaseService.java:78) at org.apache.camel.impl.engine.AbstractCamelContext.init(AbstractCamelContext.java:2021) ... 23 more Caused by: org.apache.camel.component.kamelet.KameletNotFoundException: Kamelet with id set-body-action not found in locations: file:/etc/camel/kamelets/kamelets-bundle-roll-dice-pipe-001,classpath:/kamelets at org.apache.camel.component.kamelet.KameletComponent$LifecycleHandler.createRouteForEndpoint(KameletComponent.java:439) at org.apache.camel.component.kamelet.KameletComponent$LifecycleHandler.onContextInitialized(KameletComponent.java:448) ... 27 more Caused by: java.lang.IllegalArgumentException: Route template set-body-action the following mandatory parameters must be provided: value at org.apache.camel.impl.DefaultModel.addRouteFromTemplate(DefaultModel.java:438) at org.apache.camel.impl.DefaultModel.addRouteFromTemplate(DefaultModel.java:367) at org.apache.camel.impl.DefaultCamelContext.addRouteFromTemplate(DefaultCamelContext.java:362) at org.apache.camel.component.kamelet.KameletComponent$LifecycleHandler.createRouteForEndpoint(KameletComponent.java:427) ... 28 more
The user needs to find the right part of the StackTrace to find out what is going on: "Route template set-body-action the following mandatory parameters must be provided: value"
The "KameletNotFoundException" is wrong anyways as the Kamelet has been part of the catalog in this case.