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 8C77610C02 for ; Thu, 31 Oct 2013 02:45:24 +0000 (UTC) Received: (qmail 50723 invoked by uid 500); 31 Oct 2013 02:45:24 -0000 Delivered-To: apmail-camel-users-archive@camel.apache.org Received: (qmail 50584 invoked by uid 500); 31 Oct 2013 02:45:23 -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 50576 invoked by uid 99); 31 Oct 2013 02:45:23 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 31 Oct 2013 02:45:23 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=NORMAL_HTTP_TO_IP,RCVD_IN_DNSWL_LOW,SPF_PASS,WEIRD_PORT X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of willem.jiang@gmail.com designates 209.85.220.46 as permitted sender) Received: from [209.85.220.46] (HELO mail-pa0-f46.google.com) (209.85.220.46) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 31 Oct 2013 02:45:19 +0000 Received: by mail-pa0-f46.google.com with SMTP id rd3so1846485pab.5 for ; Wed, 30 Oct 2013 19:44:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:message-id:in-reply-to:references:subject:mime-version :content-type:content-transfer-encoding:content-disposition; bh=Ymh4eaAG81MMV7CRCOYjLmkc0o59IyoXehoRv3L9gzY=; b=dLqevmahaPtDSrcxQ5VPr1yVc1+jM3d95dQREhqesdHxd7ULRU9jko1ar6yC8f6Y71 NrYN04+my/kuFF+1OhEs9fnj/D/3hG0o8jyjwy9xZIDZjsvyScdPOu692wQi0TlsLP1C NxTz6HEXef575F5c70mFm7xec+cH+pEu26IWJTdxMBSYYd03iPiMhDxBV1JgLVzQDZQk BXz7JH/O/BpJspFYTsnY1WMhdeaM4L+OYkmzAlwfUXNV9ky/PcwteRjjwVxDGEG8ALoE qAOSiMRMm5DsNPAkoLeGGUJNizeBCdPURg9njjfLVKnO3NsfhPTJEarmGnhCzJjAcuj/ +oZQ== X-Received: by 10.68.255.229 with SMTP id at5mr905440pbd.130.1383187498616; Wed, 30 Oct 2013 19:44:58 -0700 (PDT) Received: from [192.168.1.106] ([123.116.32.254]) by mx.google.com with ESMTPSA id go4sm1108950pbb.15.2013.10.30.19.44.56 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 30 Oct 2013 19:44:57 -0700 (PDT) Date: Thu, 31 Oct 2013 10:44:52 +0800 From: Willem jiang To: users@camel.apache.org Message-ID: In-Reply-To: <27C82DB4AA28D94C814599E05488E06115077753@US70UWXCHMBA06.zam.alcatel-lucent.com> References: <27C82DB4AA28D94C814599E05488E06115077753@US70UWXCHMBA06.zam.alcatel-lucent.com> Subject: Re: Component Resolution, Camel/SMX Race Condition? X-Mailer: sparrow 1.6.4 (build 1176) MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline X-Virus-Checked: Checked by ClamAV on apache.org As the cxfbeanReference wasn=E2=80=99t used by Camel as an OSGi service, = so you setting cannot block the loading of the CamelContext. How about adding the Required-Bundle of camel-cxf in your application bun= dle=3F -- =20 Willem Jiang Red Hat, Inc. Web: http://www.redhat.com Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) = (English) http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese) Twitter: willemjiang =20 Weibo: =E5=A7=9C=E5=AE=81willem On Thursday, October 31, 2013 at 5:44 AM, Calvert, Zach (Zach)** CTR ** w= rote: > This is somewhat of a cross post between here and the ApacheServiceMix = mailing list, but I'm thinking I should have fired this email to camel in= the first place. I apologize for the cross post in advance. > =20 > I'm making use of the cxfbean component in Apache ServiceMix 4.5.3. I h= ave reviewed the source and OSGI services being exposed here to try to ge= t around the race condition I am experiencing, but while the service is u= p and running, ServiceMix/Camel does not yet recognize the component and = I'm not sure who to direct this question/problem to. > =20 > Breakdown: > I have a bundle which has the following route: > =20 > > http://0.0.0.0:9089/health/=3FmatchOnUriPrefix=3Dtrue=22 /> > > > =20 > The health service implementation is a standard javax.ws.rs annotated c= lass. The cxfbean component is exposed in the camel-cxf feature under the= camel-cxf-2.10.7 bundle (I have confirmed). To try to enforce that the c= xfbean service really, really is running, I have added > interface=3D=22org.apache.camel.spi.ComponentResolver=22 > filter=3D=22(component=3Dcxfbean)=22 /> > to my bundle. This osgi reference is met and fully populated, however I= still get > =22---- > Caused by: org.apache.camel.=46ailedToCreateRouteException: =46ailed to= create > route route1 at: >>> To=5Bcxfbean:healthService=5D <<< in route: > Route=5B=5B=46rom=5Bjetty:http://0.0.0.0:9089... because of =46ailed to= resolve > endpoint: cxfbean://healthService due to: No component found with schem= e: > cxfbean > ---=22 > in my ServiceMix startup. Note that this bundle is deployed in the > apache-servicemix-4.5.3/deploy directory on a Linux machine. > =20 > This issue can be resolved simply by waiting for ServiceMix to be start= ed > for a few minutes and then run > touch ./apache-servicemix-4.5.3/deploy/ecs.bundles.health-2.3.0.25-SNAP= SHOT.jar > =20 > I would like to have the bundle block until the =22cxfbean=22 component= is fully started. Again this is a race condition and functionality is fu= lly restored by waiting a couple of minutes and then running touch on the= bundle that exposes this camel route. > =20 > Is there a way to say =22Really wait on starting this bundle until the = cxfbean component is fully started and ready to go=22=3F > =20 > =20 > Thank you, > Zach Calvert