[ https://issues.apache.org/jira/browse/CAMEL-12980?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16740200#comment-16740200 ]
Grzegorz Grzybek edited comment on CAMEL-12980 at 1/11/19 9:39 AM: ------------------------------------------------------------------- OK, Here's what I did. With sample blueprint.xml with *two* contexts (one bad, one correct): {code:xml} <blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"> <camelContext xmlns="http://camel.apache.org/schema/blueprint"> <route id="r1"> <from uri="timer://simpleTimer?period=1000&repeatCount=0&funnyopt=1" /> <setBody> <simple>Hello World 1</simple> </setBody> <to uri="log:test" /> </route> </camelContext> <camelContext xmlns="http://camel.apache.org/schema/blueprint"> <route id="r2"> <from uri="timer://simpleTimer?period=1000&repeatCount=0" /> <setBody> <simple>Hello World 2</simple> </setBody> <to uri="log:test" /> </route> </camelContext> </blueprint> {code} I've installed it using {{install -s blueprint:file:///data/tmp/blueprint.xml}} and saw: Working and visible context 2: {noformat} karaf@root()> context-list Context Status Total # Failed # Inflight # Uptime ------- ------ ------- -------- ---------- ------ camel-4 Started 7 0 0 7.662 seconds karaf@root()> route-list Context Route Status Total # Failed # Inflight # Uptime ------- ----- ------ ------- -------- ---------- ------ camel-4 r2 Started 9 0 0 9.213 seconds {noformat} Correct state for a bundle: {noformat} karaf@root()> la -l|grep blueprint.xml 65 │ Failure │ 80 │ 0.0.0 │ blueprint:file:///data/tmp/blueprint.xml {noformat} Additional diagnostic information: {noformat} karaf@root()> bundle:diag 65 Bundle 65 --------- Status: Failure Camel Blueprint Camel context "camel-1" Exception: Failed to create route r1: Route(r1)[[From[timer://simpleTimer?period=1000&repeatCount=... because of Failed to resolve endpoint: timer://simpleTimer?funnyopt=1&period=1000&repeatCount=0 due to: Failed to resolve endpoint: timer://simpleTimer?funnyopt=1&period=1000&repeatCount=0 due to: There are 1 parameters that couldn't be set on the endpoint. Check the uri if the parameters are spelt correctly and that they are properties of the endpoint. Unknown parameters=[{funnyopt=1}] org.apache.camel.FailedToCreateRouteException: Failed to create route r1: Route(r1)[[From[timer://simpleTimer?period=1000&repeatCount=... because of Failed to resolve endpoint: timer://simpleTimer?funnyopt=1&period=1000&repeatCount=0 due to: Failed to resolve endpoint: timer://simpleTimer?funnyopt=1&period=1000&repeatCount=0 due to: There are 1 parameters that couldn't be set on the endpoint. Check the uri if the parameters are spelt correctly and that they are properties of the endpoint. Unknown parameters=[{funnyopt=1}] at org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:217) at org.apache.camel.impl.DefaultCamelContext.startRoute(DefaultCamelContext.java:1140) at org.apache.camel.impl.DefaultCamelContext.startRouteDefinitions(DefaultCamelContext.java:3735) at org.apache.camel.impl.DefaultCamelContext.doStartCamel(DefaultCamelContext.java:3440) at org.apache.camel.impl.DefaultCamelContext$4.call(DefaultCamelContext.java:3248) at org.apache.camel.impl.DefaultCamelContext$4.call(DefaultCamelContext.java:3244) at org.apache.camel.impl.DefaultCamelContext.doWithDefinedClassLoader(DefaultCamelContext.java:3267) at org.apache.camel.impl.DefaultCamelContext.doStart(DefaultCamelContext.java:3244) at org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:72) at org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:3160) at org.apache.camel.blueprint.BlueprintCamelContext.start(BlueprintCamelContext.java:254) at org.apache.camel.blueprint.BlueprintCamelContext.maybeStart(BlueprintCamelContext.java:296) at org.apache.camel.blueprint.BlueprintCamelContext.blueprintEvent(BlueprintCamelContext.java:187) at org.apache.aries.blueprint.container.BlueprintEventDispatcher$3.call(BlueprintEventDispatcher.java:190) at org.apache.aries.blueprint.container.BlueprintEventDispatcher$3.call(BlueprintEventDispatcher.java:188) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) Caused by: org.apache.camel.ResolveEndpointFailedException: Failed to resolve endpoint: timer://simpleTimer?funnyopt=1&period=1000&repeatCount=0 due to: Failed to resolve endpoint: timer://simpleTimer?funnyopt=1&period=1000&repeatCount=0 due to: There are 1 parameters that couldn't be set on the endpoint. Check the uri if the parameters are spelt correctly and that they are properties of the endpoint. Unknown parameters=[{funnyopt=1}] at org.apache.camel.impl.DefaultCamelContext.getEndpoint(DefaultCamelContext.java:753) at org.apache.camel.util.CamelContextHelper.getMandatoryEndpoint(CamelContextHelper.java:80) at org.apache.camel.model.RouteDefinition.resolveEndpoint(RouteDefinition.java:227) at org.apache.camel.impl.DefaultRouteContext.resolveEndpoint(DefaultRouteContext.java:116) at org.apache.camel.impl.DefaultRouteContext.resolveEndpoint(DefaultRouteContext.java:122) at org.apache.camel.model.FromDefinition.resolveEndpoint(FromDefinition.java:75) at org.apache.camel.impl.DefaultRouteContext.getEndpoint(DefaultRouteContext.java:98) at org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:1332) at org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:212) ... 24 more Caused by: org.apache.camel.ResolveEndpointFailedException: Failed to resolve endpoint: timer://simpleTimer?funnyopt=1&period=1000&repeatCount=0 due to: There are 1 parameters that couldn't be set on the endpoint. Check the uri if the parameters are spelt correctly and that they are properties of the endpoint. Unknown parameters=[{funnyopt=1}] at org.apache.camel.impl.DefaultComponent.validateParameters(DefaultComponent.java:215) at org.apache.camel.impl.DefaultComponent.createEndpoint(DefaultComponent.java:139) at org.apache.camel.impl.DefaultCamelContext.getEndpoint(DefaultCamelContext.java:706) ... 32 more {noformat} After stopping the bundle, the status is correct and contexts are gone: {noformat} karaf@root()> context-list karaf@root()> bundle:diag 65 karaf@root()> la -l|grep blueprint.xml 65 │ Resolved │ 80 │ 0.0.0 │ blueprint:file:///data/tmp/blueprint.xml {noformat} There's single instance of new {{BundleStateService}} exposed from blueprint bundle (regardles of number of contexts it exposes): {noformat} karaf@root()> bundle:services -p 65 Bundle 65 provides: ------------------- objectClass = [org.apache.karaf.bundle.core.BundleStateService] service.bundleid = 65 service.id = 156 service.scope = singleton ... {noformat} This new service is used by {{org.apache.camel.blueprint.BlueprintCamelContext#start()}} to track state of the bundle and context. After fixing first camel context we see the state changed and diagnostic info removed: {noformat} karaf@root()> context-list Context Status Total # Failed # Inflight # Uptime ------- ------ ------- -------- ---------- ------ camel-7 Started 6 0 0 6.989 seconds camel-8 Started 6 0 0 6.963 seconds karaf@root()> bundle:diag 65 karaf@root()> la -l|grep blueprint.xml 65 │ Active │ 80 │ 0.0.0 │ blueprint:file:///data/tmp/blueprint.xml {noformat} And blueprint bundle exposes 6 services: {noformat} karaf@root()> bundle:services 65 Bundle 65 provides: ------------------- [org.apache.karaf.bundle.core.BundleStateService] [org.osgi.service.blueprint.container.BlueprintListener] [org.osgi.service.blueprint.container.BlueprintListener] [org.osgi.service.blueprint.container.BlueprintContainer] [org.apache.camel.CamelContext] [org.apache.camel.CamelContext] {noformat} camel-blueprint bundle imports additional package (optionally): {noformat} org.apache.karaf.bundle.core;resolution:=optional;version="[4,5)" {noformat} If (somehow), this package is not available (wrong Karaf version or no Karaf at all), everything works fine, but bundle is Active (again, with one correct and one broken context): {noformat} karaf@root()> bundle:diag 65 karaf@root()> la -l|grep blueprint.xml 65 │ Active │ 80 │ 0.0.0 │ blueprint:file:///data/tmp/blueprint.xml karaf@root()> context-list Context Status Total # Failed # Inflight # Uptime ------- ------ ------- -------- ---------- ------ camel-4 Started 18 0 0 18.667 seconds {noformat} And no extra, Karaf-related OSGi service is exposed: {noformat} karaf@root()> bundle:services 65 Bundle 65 provides: ------------------- [org.osgi.service.blueprint.container.BlueprintListener] [org.osgi.service.blueprint.container.BlueprintListener] [org.osgi.service.blueprint.container.BlueprintContainer] [org.apache.camel.CamelContext] {noformat} If there's actual Blueprint (non-Camel) problem, we can see it too: {noformat} karaf@root()> la -l|grep 65 65 │ Failure │ 80 │ 0.0.0 │ blueprint:file:///data/tmp/blueprint.xml karaf@root()> bundle:diag 65 Bundle 65 --------- Status: Failure Blueprint 1/11/19 10:38 AM Exception: Unable to validate xml org.osgi.service.blueprint.container.ComponentDefinitionException: Unable to validate xml at org.apache.aries.blueprint.parser.Parser.validate(Parser.java:349) at org.apache.aries.blueprint.parser.Parser.validate(Parser.java:336) at org.apache.aries.blueprint.container.BlueprintContainerImpl.doRun(BlueprintContainerImpl.java:345) at org.apache.aries.blueprint.container.BlueprintContainerImpl.run(BlueprintContainerImpl.java:278) at org.apache.aries.blueprint.container.BlueprintExtender.createContainer(BlueprintExtender.java:299) at org.apache.aries.blueprint.container.BlueprintExtender.createContainer(BlueprintExtender.java:268) at org.apache.aries.blueprint.container.BlueprintExtender.createContainer(BlueprintExtender.java:264) at org.apache.aries.blueprint.container.BlueprintExtender.modifiedBundle(BlueprintExtender.java:254) at org.apache.aries.util.tracker.hook.BundleHookBundleTracker$Tracked.customizerModified(BundleHookBundleTracker.java:500) at org.apache.aries.util.tracker.hook.BundleHookBundleTracker$Tracked.customizerModified(BundleHookBundleTracker.java:433) at org.apache.aries.util.tracker.hook.BundleHookBundleTracker$AbstractTracked.track(BundleHookBundleTracker.java:725) at org.apache.aries.util.tracker.hook.BundleHookBundleTracker$Tracked.bundleChanged(BundleHookBundleTracker.java:463) at org.apache.aries.util.tracker.hook.BundleHookBundleTracker$BundleEventHook.event(BundleHookBundleTracker.java:422) at org.apache.felix.framework.util.SecureAction.invokeBundleEventHook(SecureAction.java:1179) at org.apache.felix.framework.EventDispatcher.createWhitelistFromHooks(EventDispatcher.java:730) at org.apache.felix.framework.EventDispatcher.fireBundleEvent(EventDispatcher.java:485) at org.apache.felix.framework.Felix.fireBundleEvent(Felix.java:4579) at org.apache.felix.framework.Felix.startBundle(Felix.java:2174) at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:998) at org.apache.karaf.bundle.command.Start.executeOnBundle(Start.java:38) at org.apache.karaf.bundle.command.BundlesCommand.doExecute(BundlesCommand.java:65) at org.apache.karaf.bundle.command.BundlesCommand.execute(BundlesCommand.java:55) at org.apache.karaf.shell.impl.action.command.ActionCommand.execute(ActionCommand.java:84) at org.apache.karaf.shell.impl.console.osgi.secured.SecuredCommand.execute(SecuredCommand.java:68) at org.apache.karaf.shell.impl.console.osgi.secured.SecuredCommand.execute(SecuredCommand.java:86) at org.apache.felix.gogo.runtime.Closure.executeCmd(Closure.java:599) at org.apache.felix.gogo.runtime.Closure.executeStatement(Closure.java:526) at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:415) at org.apache.felix.gogo.runtime.Pipe.doCall(Pipe.java:416) at org.apache.felix.gogo.runtime.Pipe.call(Pipe.java:229) at org.apache.felix.gogo.runtime.Pipe.call(Pipe.java:59) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) Caused by: org.xml.sax.SAXParseException; cvc-complex-type.2.4.c: The matching wildcard is strict, but no declaration can be found for element 'camelaContext'. at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:203) at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:134) at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:396) at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:327) at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:284) at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator$XSIErrorReporter.reportError(XMLSchemaValidator.java:453) at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.reportSchemaError(XMLSchemaValidator.java:3231) at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.handleStartElement(XMLSchemaValidator.java:1912) at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.startElement(XMLSchemaValidator.java:741) at com.sun.org.apache.xerces.internal.jaxp.validation.DOMValidatorHelper.beginNode(DOMValidatorHelper.java:277) at com.sun.org.apache.xerces.internal.jaxp.validation.DOMValidatorHelper.validate(DOMValidatorHelper.java:244) at com.sun.org.apache.xerces.internal.jaxp.validation.DOMValidatorHelper.validate(DOMValidatorHelper.java:190) at com.sun.org.apache.xerces.internal.jaxp.validation.ValidatorImpl.validate(ValidatorImpl.java:109) at javax.xml.validation.Validator.validate(Validator.java:124) at org.apache.aries.blueprint.parser.Parser.validate(Parser.java:346) ... 34 more {noformat} was (Author: gzres): OK, Here's what I did. With sample blueprint.xml with *two* contexts (one bad, one correct): {code:xml} <blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"> <camelContext xmlns="http://camel.apache.org/schema/blueprint"> <route id="r1"> <from uri="timer://simpleTimer?period=1000&repeatCount=0&funnyopt=1" /> <setBody> <simple>Hello World 1</simple> </setBody> <to uri="log:test" /> </route> </camelContext> <camelContext xmlns="http://camel.apache.org/schema/blueprint"> <route id="r2"> <from uri="timer://simpleTimer?period=1000&repeatCount=0" /> <setBody> <simple>Hello World 2</simple> </setBody> <to uri="log:test" /> </route> </camelContext> </blueprint> {code} I've installed it using {{install -s blueprint:file:///data/tmp/blueprint.xml}} and saw: Working and visible context 2: {noformat} karaf@root()> context-list Context Status Total # Failed # Inflight # Uptime ------- ------ ------- -------- ---------- ------ camel-4 Started 7 0 0 7.662 seconds karaf@root()> route-list Context Route Status Total # Failed # Inflight # Uptime ------- ----- ------ ------- -------- ---------- ------ camel-4 r2 Started 9 0 0 9.213 seconds {noformat} Correct state for a bundle: {noformat} karaf@root()> la -l|grep blueprint.xml 65 │ Failure │ 80 │ 0.0.0 │ blueprint:file:///data/tmp/blueprint.xml {noformat} Additional diagnostic information: {noformat} karaf@root()> bundle:diag 65 Bundle 65 --------- Status: Failure Camel Blueprint Camel context "camel-1" Exception: Failed to create route r1: Route(r1)[[From[timer://simpleTimer?period=1000&repeatCount=... because of Failed to resolve endpoint: timer://simpleTimer?funnyopt=1&period=1000&repeatCount=0 due to: Failed to resolve endpoint: timer://simpleTimer?funnyopt=1&period=1000&repeatCount=0 due to: There are 1 parameters that couldn't be set on the endpoint. Check the uri if the parameters are spelt correctly and that they are properties of the endpoint. Unknown parameters=[{funnyopt=1}] org.apache.camel.FailedToCreateRouteException: Failed to create route r1: Route(r1)[[From[timer://simpleTimer?period=1000&repeatCount=... because of Failed to resolve endpoint: timer://simpleTimer?funnyopt=1&period=1000&repeatCount=0 due to: Failed to resolve endpoint: timer://simpleTimer?funnyopt=1&period=1000&repeatCount=0 due to: There are 1 parameters that couldn't be set on the endpoint. Check the uri if the parameters are spelt correctly and that they are properties of the endpoint. Unknown parameters=[{funnyopt=1}] at org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:217) at org.apache.camel.impl.DefaultCamelContext.startRoute(DefaultCamelContext.java:1140) at org.apache.camel.impl.DefaultCamelContext.startRouteDefinitions(DefaultCamelContext.java:3735) at org.apache.camel.impl.DefaultCamelContext.doStartCamel(DefaultCamelContext.java:3440) at org.apache.camel.impl.DefaultCamelContext$4.call(DefaultCamelContext.java:3248) at org.apache.camel.impl.DefaultCamelContext$4.call(DefaultCamelContext.java:3244) at org.apache.camel.impl.DefaultCamelContext.doWithDefinedClassLoader(DefaultCamelContext.java:3267) at org.apache.camel.impl.DefaultCamelContext.doStart(DefaultCamelContext.java:3244) at org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:72) at org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:3160) at org.apache.camel.blueprint.BlueprintCamelContext.start(BlueprintCamelContext.java:254) at org.apache.camel.blueprint.BlueprintCamelContext.maybeStart(BlueprintCamelContext.java:296) at org.apache.camel.blueprint.BlueprintCamelContext.blueprintEvent(BlueprintCamelContext.java:187) at org.apache.aries.blueprint.container.BlueprintEventDispatcher$3.call(BlueprintEventDispatcher.java:190) at org.apache.aries.blueprint.container.BlueprintEventDispatcher$3.call(BlueprintEventDispatcher.java:188) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) Caused by: org.apache.camel.ResolveEndpointFailedException: Failed to resolve endpoint: timer://simpleTimer?funnyopt=1&period=1000&repeatCount=0 due to: Failed to resolve endpoint: timer://simpleTimer?funnyopt=1&period=1000&repeatCount=0 due to: There are 1 parameters that couldn't be set on the endpoint. Check the uri if the parameters are spelt correctly and that they are properties of the endpoint. Unknown parameters=[{funnyopt=1}] at org.apache.camel.impl.DefaultCamelContext.getEndpoint(DefaultCamelContext.java:753) at org.apache.camel.util.CamelContextHelper.getMandatoryEndpoint(CamelContextHelper.java:80) at org.apache.camel.model.RouteDefinition.resolveEndpoint(RouteDefinition.java:227) at org.apache.camel.impl.DefaultRouteContext.resolveEndpoint(DefaultRouteContext.java:116) at org.apache.camel.impl.DefaultRouteContext.resolveEndpoint(DefaultRouteContext.java:122) at org.apache.camel.model.FromDefinition.resolveEndpoint(FromDefinition.java:75) at org.apache.camel.impl.DefaultRouteContext.getEndpoint(DefaultRouteContext.java:98) at org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:1332) at org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:212) ... 24 more Caused by: org.apache.camel.ResolveEndpointFailedException: Failed to resolve endpoint: timer://simpleTimer?funnyopt=1&period=1000&repeatCount=0 due to: There are 1 parameters that couldn't be set on the endpoint. Check the uri if the parameters are spelt correctly and that they are properties of the endpoint. Unknown parameters=[{funnyopt=1}] at org.apache.camel.impl.DefaultComponent.validateParameters(DefaultComponent.java:215) at org.apache.camel.impl.DefaultComponent.createEndpoint(DefaultComponent.java:139) at org.apache.camel.impl.DefaultCamelContext.getEndpoint(DefaultCamelContext.java:706) ... 32 more {noformat} After stopping the bundle, the status is correct and contexts are gone: {noformat} karaf@root()> context-list karaf@root()> bundle:diag 65 karaf@root()> la -l|grep blueprint.xml 65 │ Resolved │ 80 │ 0.0.0 │ blueprint:file:///data/tmp/blueprint.xml {noformat} There's single instance of new {{BundleStateService}} exposed from blueprint bundle (regardles of number of contexts it exposes): {noformat} karaf@root()> bundle:services -p 65 Bundle 65 provides: ------------------- objectClass = [org.apache.karaf.bundle.core.BundleStateService] service.bundleid = 65 service.id = 156 service.scope = singleton ... {noformat} This new service is used by {{org.apache.camel.blueprint.BlueprintCamelContext#start()}} to track state of the bundle and context. After fixing first camel context we see the state changed and diagnostic info removed: {noformat} karaf@root()> context-list Context Status Total # Failed # Inflight # Uptime ------- ------ ------- -------- ---------- ------ camel-7 Started 6 0 0 6.989 seconds camel-8 Started 6 0 0 6.963 seconds karaf@root()> bundle:diag 65 karaf@root()> la -l|grep blueprint.xml 65 │ Active │ 80 │ 0.0.0 │ blueprint:file:///data/tmp/blueprint.xml {noformat} And blueprint bundle exposes 6 services: {noformat} karaf@root()> bundle:services 65 Bundle 65 provides: ------------------- [org.apache.karaf.bundle.core.BundleStateService] [org.osgi.service.blueprint.container.BlueprintListener] [org.osgi.service.blueprint.container.BlueprintListener] [org.osgi.service.blueprint.container.BlueprintContainer] [org.apache.camel.CamelContext] [org.apache.camel.CamelContext] {noformat} camel-blueprint bundle imports additional package (optionally): {noformat} org.apache.karaf.bundle.core;resolution:=optional;version="[4,5)" {noformat} If (somehow), this package is not available (wrong Karaf version or no Karaf at all), everything works fine, but bundle is Active (again, with one correct and one broken context): {noformat} karaf@root()> bundle:diag 65 karaf@root()> la -l|grep blueprint.xml 65 │ Active │ 80 │ 0.0.0 │ blueprint:file:///data/tmp/blueprint.xml karaf@root()> context-list Context Status Total # Failed # Inflight # Uptime ------- ------ ------- -------- ---------- ------ camel-4 Started 18 0 0 18.667 seconds {noformat} And no extra, Karaf-related OSGi service is exposed: {noformat} karaf@root()> bundle:services 65 Bundle 65 provides: ------------------- [org.osgi.service.blueprint.container.BlueprintListener] [org.osgi.service.blueprint.container.BlueprintListener] [org.osgi.service.blueprint.container.BlueprintContainer] [org.apache.camel.CamelContext] {noformat} > Bundle in 'Active' State but Camel Context not initialized > ---------------------------------------------------------- > > Key: CAMEL-12980 > URL: https://issues.apache.org/jira/browse/CAMEL-12980 > Project: Camel > Issue Type: Bug > Components: camel-blueprint > Affects Versions: 2.20.1, 2.21.1 > Reporter: Xilai Dai > Assignee: Grzegorz Grzybek > Priority: Critical > Fix For: 3.0.0, 2.24.0 > > Attachments: blueprint.xml > > > The camel context can't get initialized when validation of the > RouteDefinition failed (e.g. typo in Uri or add an unsupported option in > Uri), but when deploy the blueprint, the CamelContext startup and then > shutdown, but the bundle status is still 'Active', only a > FailedToCreateRouteException ERROR is logged. > 318 │ Active │ 80 │ 0.0.0 │ blueprint.xml > Attached the simple blueprint.xml for reproduce it. > The expected behaviour is the bundle is in the 'Failure' status in this case. > The fix proposal from my side is, move the call of "this.maybeStart()" from > blueprintEvent() method to the constructor of the BlueprintCamelContext > class. then this kind of Route definition error can be processed during the > Blueprint "CREATING" phase. Currently, the start() is invoked after Blueprint > in "CREATED" phase. (I tested this fix locally and have the expected > 'Failure' bundle status) > (This issue is found in Camel 2.20.x, 2.21.x, but it may affects also on > master branch) -- This message was sent by Atlassian JIRA (v7.6.3#76005)