camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Lichtin <mar...@lichtin.net>
Subject Re: Re: Issue with timer:// route, NoSuchBeanException on route shutdown
Date Tue, 26 May 2015 19:06:32 GMT
Using Blueprint in an OSGi bundle:

     <bean id="myBean" init-method="init" destroy-method="destroy" 
class="myPkg.MyBean">
     </bean>

     <camelContext xmlns="http://camel.apache.org/schema/blueprint" 
xsi:schemaLocation="http://camel.apache.org/schema/blueprint 
http://camel.apache.org/schema/blueprint/camel-blueprint.xsd"
         id="myRouteContext" depends-on="myBean">
         <route id="myTimer">
             <from uri="timer://myTimer?fixedRate=true&amp;period=2000" />
             <to uri="bean:myBean" />
         </route>
     </camelContext>

The issue seems to have started popping up after upgrading to Camel 2.15.x.

On 26.05.2015 14:14, Claus Ibsen wrote:
> Hi
>
> Are you using a spring xml file? Then its spring app context that is
> the registry. Camel does not remove any beans from it. Its spring that
> does that. So maybe you have some depends-on spring attribute order
> wrong or something.
>
> On Tue, May 26, 2015 at 12:41 PM, Martin Lichtin
> <lichtin@yahoo.com.invalid> wrote:
>> Is anyone else seeing this issue on shutting down a simple timer-based route such
as
>>
>> <route id=myRoute">
>>                          <from uri=timer://myTimer?fixedRate=true&amp;period
00" />
>>                          <to uri=bean:myBean" />
>> </route>
>>
>> On shutting down, it reports
>>
>> 2015-05-22 01:20:14,970 | INFO  | FelixStartLevel          | DefaultShutdownStrategy
         | mel.impl.DefaultShutdownStrategy  184 | 94 - org.apache.camel.camel-core - 2.15.1
| Starting to graceful shutdown 1 routes (timeout 300 seconds)
>> 2015-05-22 01:20:16,634 | WARN  | timer://myRoute | TimerConsumer               
    | rg.apache.camel.util.CamelLogger  224 | 94 - org.apache.camel.camel-core - 2.15.1 |
Error processing exchange. Exchange[Message: [Body is null]]. Caused by: [org.apache.camel.NoSuchBeanException
- No bean could be found in the registry for: myBean]
>> org.apache.camel.NoSuchBeanException: No bean could be found in the registry for:
myBean
>> at org.apache.camel.component.bean.RegistryBean.getBean(RegistryBean.java:85)[94:org.apache.camel.camel-core:2.15.1]
>> at org.apache.camel.component.bean.BeanProcessor.process(BeanProcessor.java:78)[94:org.apache.camel.camel-core:2.15.1]
>>
>>
>> I have double-checked that bean "myBean" is still around at this point in time.
>> It seems perhaps the bean is prematurely removed from the registry?
>> Or the timer for some reason fires even though the route is in the middle shutting
down?
>>
>> - Martin

Mime
View raw message