Hi

Yeah would assume depends-on attributes ought to tell blueprint in
which order to shutdown its beans etc.
Or somehow you can try to get <camelContext> as being the first "bean"
blueprint should try to shutdown, as then Camel will complete all its
inflight messages first, and hence the <beans> should be shutdown
later.

You can also enable cache on the bean endpoint to avoid the lookups

  <bean uri="ref:myBean?cache=true" />

And see if that helps.
http://camel.apache.org/bean


And when you see this error, does that only happen if the aggregator
has messages that hasn't been fully aggregated, but are forced to be
completed when stopping? eg this doesn't happen when stopping and the
aggregator is empty?



On Tue, Apr 30, 2013 at 1:25 PM, Tobias Hofer <tobias.ho...@basis06.ch> wrote:
> Hi all,
>
> I'm running Camel 2.10.4 in Karaf 2.3.1 and get NoSuchComponentException
> during the shutdown process.
>
> My blueprint configuration file declares a bean which is a Camel Processor
>
> <bean id="myBean" class="org.example.MyBean" />
>
> The CamelContext contains a route that aggregates incoming messages and
> which forces a completion on stop.
>
> <route>
>   <from uri="direct:aggregate" />
>   <aggregate strategyRef="aggregationStrategy"
>       forceCompletionOnStop="true" ...>
>     ...
>     <to uri="direct:onCompletion" />
>   </aggregate>
> </route>
>
> The second route contains the bean invocation
>
> <route>
>   <from uri="direct:onCompletion" />
>   ...
>   <bean ref="myBean" />
>   ...
> </route>
>
> During shutdown the bean invocation in the second route fails
>
> org.apache.camel.RuntimeCamelException: 
> org.osgi.service.blueprint.container.NoSuchComponentException: No component 
> with id
> 'myBean' could be found
>         at 
> org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHelper.java:1316)
>         at 
> org.apache.camel.impl.PropertyPlaceholderDelegateRegistry.lookup(PropertyPlaceholderDelegateRegistry.java:51)
>         at 
> org.apache.camel.component.bean.RegistryBean.lookupBean(RegistryBean.java:136)
>         at 
> org.apache.camel.component.bean.RegistryBean.getBean(RegistryBean.java:62)
>         at 
> org.apache.camel.component.bean.BeanProcessor.process(BeanProcessor.java:77)
>         at 
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)
>         ...
> Caused by: org.osgi.service.blueprint.container.NoSuchComponentException: No 
> component with id 'myBean' could be found
>         at 
> org.apache.aries.blueprint.container.BlueprintContainerImpl.getComponentInstance(BlueprintContainerImpl.java:742)
>         at 
> org.apache.camel.blueprint.BlueprintContainerRegistry.lookup(BlueprintContainerRegistry.java:41)
>         at 
> org.apache.camel.impl.CompositeRegistry.lookup(CompositeRegistry.java:68)
>         at 
> org.apache.camel.impl.PropertyPlaceholderDelegateRegistry.lookup(PropertyPlaceholderDelegateRegistry.java:49)
>
> I tried to add a 'depends-on' property on the CamelContext declaration but
> this seems not to help.
>
> It looks like that the Blueprint Container is no longer available.
>
> Any suggestions?
>
> Regards,
> Tobias Hofer
>
>
>
>
>



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
FuseSource is now part of Red Hat
Email: cib...@redhat.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen

Reply via email to