Return-Path: X-Original-To: apmail-camel-users-archive@www.apache.org Delivered-To: apmail-camel-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id F064618DD1 for ; Fri, 29 May 2015 14:36:45 +0000 (UTC) Received: (qmail 42849 invoked by uid 500); 29 May 2015 14:36:45 -0000 Delivered-To: apmail-camel-users-archive@camel.apache.org Received: (qmail 42804 invoked by uid 500); 29 May 2015 14:36:45 -0000 Mailing-List: contact users-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@camel.apache.org Delivered-To: mailing list users@camel.apache.org Received: (qmail 42793 invoked by uid 99); 29 May 2015 14:36:45 -0000 Received: from Unknown (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 29 May 2015 14:36:45 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id AFD9D1A3FFE for ; Fri, 29 May 2015 14:36:44 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 4.189 X-Spam-Level: **** X-Spam-Status: No, score=4.189 tagged_above=-999 required=6.31 tests=[DKIM_ADSP_CUSTOM_MED=0.001, FORGED_YAHOO_RCVD=1.022, NML_ADSP_CUSTOM_MED=1.2, SPF_NEUTRAL=0.652, URIBL_BLOCKED=0.001, URI_HEX=1.313] autolearn=disabled Received: from mx1-us-west.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id j3WpNxZ3HMqR for ; Fri, 29 May 2015 14:36:36 +0000 (UTC) Received: from mbob.nabble.com (mbob.nabble.com [162.253.133.15]) by mx1-us-west.apache.org (ASF Mail Server at mx1-us-west.apache.org) with ESMTP id E4CC024CEB for ; Fri, 29 May 2015 14:36:35 +0000 (UTC) Received: from msam.nabble.com (unknown [162.253.133.85]) by mbob.nabble.com (Postfix) with ESMTP id 9B9A5DCC714 for ; Fri, 29 May 2015 07:36:35 -0700 (PDT) Date: Fri, 29 May 2015 07:36:35 -0700 (MST) From: Martin Lichtin To: users@camel.apache.org Message-ID: <1432910195364-5767649.post@n5.nabble.com> In-Reply-To: <556628FC.2050603@yahoo.com> References: <1734399067.2199997.1432636873498.JavaMail.yahoo@mail.yahoo.com> <5564CFD5.7060502@yahoo.com> <556628FC.2050603@yahoo.com> Subject: Re: Issue with timer:// route, NoSuchBeanException on route shutdown MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit In the end, the solution was to replace with This way, the bean is still referencend and can be called while the other context is shutting down. - Martin Martin Lichtin-2 wrote > This didn't make a difference. > > However, something else I noticed. There is a second CamelContext defined > in the same Blueprint file. > This Camel context is shutdown first. > As it contains a from(jms:) endpoint, the shutdown takes a few secs (and > that's why the timer-based route in the "myRouteContext" context can still > fire a timer). > > This second Camel context seems to influence the one that's then having > the bean lookup issue. > As soon as I comment out that 2nd context, the NoSuchBeanException > disappears. > > On 27.05.2015 08:39, Claus Ibsen wrote: >> Try remove the depends-on, not sure if blueprint shutdown in reverse >> order and therefore the bean before camel etc. >> >> On Tue, May 26, 2015 at 9:56 PM, Martin Lichtin >> < > lichtin@.com > > wrote: >>> Using Blueprint in an OSGi bundle: >>> >>> > > >> class="myPkg.MyBean"> >>> > >>> >>> > > >> xsi:schemaLocation="http://camel.apache.org/schema/blueprint >>> http://camel.apache.org/schema/blueprint/camel-blueprint.xsd" >>> id="myRouteContext" depends-on="myBean"> >>> > >>> > >>> > >>> > >>> > >>> >>> 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@.com > > wrote: >>>>> Is anyone else seeing this issue on shutting down a simple timer-based >>>>> route such as >>>>> >>>>> > >>>>> > > >>>> uri=timer://myTimer?fixedRate=true&period 00" /> >>>>> > >>>>> > >>>>> >>>>> 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 >> >> -- View this message in context: http://camel.465427.n5.nabble.com/Issue-with-timer-route-NoSuchBeanException-on-route-shutdown-tp5767470p5767649.html Sent from the Camel - Users mailing list archive at Nabble.com.