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 D383C17D57 for ; Fri, 12 Jun 2015 04:32:28 +0000 (UTC) Received: (qmail 53468 invoked by uid 500); 12 Jun 2015 04:32:28 -0000 Delivered-To: apmail-camel-users-archive@camel.apache.org Received: (qmail 53418 invoked by uid 500); 12 Jun 2015 04:32:28 -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 53406 invoked by uid 99); 12 Jun 2015 04:32:27 -0000 Received: from Unknown (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 12 Jun 2015 04:32:27 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id 65AE8C0613 for ; Fri, 12 Jun 2015 04:32:27 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 2.88 X-Spam-Level: ** X-Spam-Status: No, score=2.88 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=3, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=disabled Authentication-Results: spamd4-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-us-west.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id rLlCoScdDoe4 for ; Fri, 12 Jun 2015 04:32:19 +0000 (UTC) Received: from mail-ig0-f181.google.com (mail-ig0-f181.google.com [209.85.213.181]) by mx1-us-west.apache.org (ASF Mail Server at mx1-us-west.apache.org) with ESMTPS id 0DF7F261AF for ; Fri, 12 Jun 2015 04:32:19 +0000 (UTC) Received: by igblz2 with SMTP id lz2so3981942igb.1 for ; Thu, 11 Jun 2015 21:32:18 -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; bh=e8zkheZ82cgot6BsnnGS3h5KYmi8UOG9KHDljGbkmI0=; b=P8EAEd0IzLhvqZe3EyMTPos9OP0ahn5i6Hv3K/HL4mNZvLWsdyWwO7QxcxC7rl4ttO uiGrisJ0v3rEk1ULnmJv+uuJZLFvU9nY4+vwjtOpUge5uU7vZmzjkU9TG5ClEWRbmPem /vtkoADrS3pNoq7YI950+iVuHVcl9w7Btxv9J9ywtkqRQCqxuqZXPnh6R54G7RPslVl1 oYKHWrs8A1CJhQtVbNtDxueawzitgAIbEiQma1+0HplFpM890OgeXeUt6Ih8l0GQss2K QxCDpvQhtM2JgvlGOZgM7Zp1gnaPt1DtCwKZd7JH2KtaIM/qGlrqbpl1M0AC+iFLOekI GCYw== X-Received: by 10.50.61.234 with SMTP id t10mr1937507igr.19.1434083538502; Thu, 11 Jun 2015 21:32:18 -0700 (PDT) Received: from Andrews-MacBook-Pro-2.local (205-178-77-85.c3-0.nwb-ubr1.chi-nwb.il.cable.rcn.com. [205.178.77.85]) by mx.google.com with ESMTPSA id a82sm1840382ioe.22.2015.06.11.21.32.17 (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 11 Jun 2015 21:32:17 -0700 (PDT) Date: Thu, 11 Jun 2015 23:32:17 -0500 From: Andrew Block To: users@camel.apache.org, John Dubchak Message-ID: In-Reply-To: <557A0B7D.2070704@johndubchak.com> References: <557A0B7D.2070704@johndubchak.com> Subject: Re: ClassCastException in blueprint Route X-Mailer: Airmail (249) MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="557a60d1_7c3dbd3d_13c" --557a60d1_7c3dbd3d_13c Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline John,=C2=A0 Would you be able to post how the service is being declared along with th= e service properties to ensure the correct service is being referenced in= your consumer blueprint. Thanks, Andy --=C2=A0 Andrew Block On June 11, 2015 at 5:28:54 PM, John Dubchak (john=40johndubchak.com) wro= te: Hi, =20 I have a service component, deployed as a separate bundle, that exports =20 a package, com.example.services.configuration, and a service that =20 implements a ConfigurationService interface in another package called =20 LocalService: =20 com.example.services.configruation.ConfigurationService =20 com.example.services.configruation.local.LocalConfigurationService =20 Another bundle imports the service using a filter (from the blueprint XML= ): =20 =20 and sets it as a property on a route bean. When I start this second =20 bundle in ServiceMix I am getting a stacktrace =5B1=5D and just can't see= m =20 to figure out what I am doing wrong. Any guidance is very much appreciate= d. =20 John =20 =5B1=5D =20 2015-06-11 21:59:41,641 =7C ERROR =7C Thread-58 =7C =20 BlueprintContainerImpl =7C =3F =3F =20 =7C 7 - org.apache.aries.blueprint.core - 1.4.0 =7C Unable to start =20 blueprint container for bundle my-process-router =20 org.osgi.service.blueprint.container.ComponentDefinitionException: =20 Unable to initialize bean .camelBlueprint.factory.eventRouterContext =20 at =20 org.apache.aries.blueprint.container.BeanRecipe.runBeanProcInit(BeanRecip= e.java:714) =20 at =20 org.apache.aries.blueprint.container.BeanRecipe.internalCreate2(BeanRecip= e.java:824) =20 at =20 org.apache.aries.blueprint.container.BeanRecipe.internalCreate(BeanRecipe= .java:787) =20 at =20 org.apache.aries.blueprint.di.AbstractRecipe=241.call(AbstractRecipe.java= :79) =20 at =20 java.util.concurrent.=46utureTask.run(=46utureTask.java:262)=5B:1.7.0=5F6= 0-ea=5D =20 at =20 org.apache.aries.blueprint.di.AbstractRecipe.create(AbstractRecipe.java:8= 8) =20 at =20 org.apache.aries.blueprint.container.BlueprintRepository.createInstances(= BlueprintRepository.java:245) =20 at =20 org.apache.aries.blueprint.container.BlueprintRepository.createInstance(B= lueprintRepository.java:230) =20 at =20 org.apache.aries.blueprint.container.BlueprintRepository.create(Blueprint= Repository.java:145) =20 at =20 org.apache.aries.blueprint.container.BlueprintContainerImpl.getComponentI= nstance(BlueprintContainerImpl.java:753) =20 at =20 org.apache.camel.blueprint.handler.CamelNamespaceHandler=24CamelDependenc= ies=46inder.process(CamelNamespaceHandler.java:863) =20 at =20 org.apache.aries.blueprint.container.BlueprintContainerImpl.processProces= sors(BlueprintContainerImpl.java:528) =20 at =20 org.apache.aries.blueprint.container.BlueprintContainerImpl.doRun(Bluepri= ntContainerImpl.java:361) =20 at =20 org.apache.aries.blueprint.container.BlueprintContainerImpl.run(Blueprint= ContainerImpl.java:269) =20 at =20 org.apache.aries.blueprint.container.BlueprintExtender.createContainer(Bl= ueprintExtender.java:276) =20 at =20 org.apache.aries.blueprint.container.BlueprintExtender.createContainer(Bl= ueprintExtender.java:245) =20 at =20 org.apache.aries.blueprint.container.BlueprintExtender.modifiedBundle(Blu= eprintExtender.java:235) =20 at =20 org.apache.aries.util.tracker.hook.BundleHookBundleTracker=24Tracked.cust= omizerModified(BundleHookBundleTracker.java:500) =20 at =20 org.apache.aries.util.tracker.hook.BundleHookBundleTracker=24Tracked.cust= omizerModified(BundleHookBundleTracker.java:433) =20 at =20 org.apache.aries.util.tracker.hook.BundleHookBundleTracker=24AbstractTrac= ked.track(BundleHookBundleTracker.java:725) =20 at =20 org.apache.aries.util.tracker.hook.BundleHookBundleTracker=24Tracked.bund= leChanged(BundleHookBundleTracker.java:463) =20 at =20 org.apache.aries.util.tracker.hook.BundleHookBundleTracker=24BundleEventH= ook.event(BundleHookBundleTracker.java:422) =20 at =20 org.apache.felix.framework.util.SecureAction.invokeBundleEventHook(Secure= Action.java:1103) =20 at =20 org.apache.felix.framework.util.EventDispatcher.createWhitelist=46romHook= s(EventDispatcher.java:695) =20 at =20 org.apache.felix.framework.util.EventDispatcher.fireBundleEvent(EventDisp= atcher.java:483) =20 at =20 org.apache.felix.framework.=46elix.fireBundleEvent(=46elix.java:4244) =20 at org.apache.felix.framework.=46elix.startBundle(=46elix.java:1923) =20 at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:944) =20 at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:931) =20 at =20 org.apache.karaf.shell.osgi.StartBundle.doExecute(StartBundle.java:37) =20 at =20 org.apache.karaf.shell.osgi.BundlesCommand.doExecute(BundlesCommand.java:= 37) =20 at =20 org.apache.karaf.shell.console.OsgiCommandSupport.execute(OsgiCommandSupp= ort.java:38)=5B15:org.apache.karaf.shell.console:2.3.4=5D =20 at =20 org.apache.felix.gogo.commands.basic.AbstractCommand.execute(AbstractComm= and.java:35)=5B15:org.apache.karaf.shell.console:2.3.4=5D =20 at =20 org.apache.felix.gogo.runtime.CommandProxy.execute(CommandProxy.java:78)=5B= 15:org.apache.karaf.shell.console:2.3.4=5D =20 at =20 org.apache.felix.gogo.runtime.Closure.executeCmd(Closure.java:474)=5B15:o= rg.apache.karaf.shell.console:2.3.4=5D =20 at =20 org.apache.felix.gogo.runtime.Closure.executeStatement(Closure.java:400)=5B= 15:org.apache.karaf.shell.console:2.3.4=5D =20 at =20 org.apache.felix.gogo.runtime.Pipe.run(Pipe.java:108)=5B15:org.apache.kar= af.shell.console:2.3.4=5D =20 at =20 org.apache.felix.gogo.runtime.Closure.execute(Closure.java:183)=5B15:org.= apache.karaf.shell.console:2.3.4=5D =20 at =20 org.apache.felix.gogo.runtime.Closure.execute(Closure.java:120)=5B15:org.= apache.karaf.shell.console:2.3.4=5D =20 at =20 org.apache.felix.gogo.runtime.CommandSessionImpl.execute(CommandSessionIm= pl.java:89) =20 at =20 org.apache.karaf.shell.console.jline.Console.run(Console.java:183) =20 at java.lang.Thread.run(Thread.java:744)=5B:1.7.0=5F60-ea=5D =20 at =20 org.apache.karaf.shell.ssh.Shell=46actoryImpl=24ShellImpl=244.doRun(Shell= =46actoryImpl.java:144)=5B47:org.apache.karaf.shell.ssh:2.3.4=5D =20 at =20 org.apache.karaf.shell.ssh.Shell=46actoryImpl=24ShellImpl=244=241.run(She= ll=46actoryImpl.java:135) =20 at java.security.AccessController.doPrivileged(Native =20 Method)=5B:1.7.0=5F60-ea=5D =20 at javax.security.auth.Subject.doAs(Subject.java:356)=5B:1.7.0=5F60-ea=5D= =20 at =20 org.apache.karaf.shell.ssh.Shell=46actoryImpl=24ShellImpl=244.run(Shell=46= actoryImpl.java:133)=5B47:org.apache.karaf.shell.ssh:2.3.4=5D =20 Caused by: java.lang.ClassCastException: =20 com.example.services.configuration.local.LocalConfigurationService =20 cannot be cast to com.example.services.configuration.ConfigurationService= =20 at =20 Proxy5216067d=5Fed21=5F408f=5Fb02b=5F9397ef0efbb3.getCurrentConfiguration= (Unknown Source) =20 at =20 com.example.services.routes.ConfigurableEndpointPair.getConfiguration(Con= figurableEndpointPair.java:24) =20 at =20 com.example.services.routes.ConfigurableEndpointPair.getInbound(Configura= bleEndpointPair.java:53) =20 at =20 com.example.services.routes.EventRoute.configure(EventRoute.java:55) =20 at =20 org.apache.camel.builder.RouteBuilder.checkInitialized(RouteBuilder.java:= 322) =20 at =20 org.apache.camel.builder.RouteBuilder.configureRoutes(RouteBuilder.java:2= 76) =20 at =20 org.apache.camel.builder.RouteBuilder.addRoutesToCamelContext(RouteBuilde= r.java:262) =20 at =20 org.apache.camel.impl.DefaultCamelContext.addRoutes(DefaultCamelContext.j= ava:679) =20 at =20 org.apache.camel.core.xml.AbstractCamelContext=46actoryBean.installRoutes= (AbstractCamelContext=46actoryBean.java:761) =20 at =20 org.apache.camel.core.xml.AbstractCamelContext=46actoryBean.setupRoutes(A= bstractCamelContext=46actoryBean.java:311) =20 at =20 org.apache.camel.blueprint.CamelContext=46actoryBean.afterPropertiesSet(C= amelContext=46actoryBean.java:304) =20 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native =20 Method)=5B:1.7.0=5F60-ea=5D =20 at =20 sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java= :57)=5B:1.7.0=5F60-ea=5D =20 at =20 sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorI= mpl.java:43)=5B:1.7.0=5F60-ea=5D =20 at java.lang.reflect.Method.invoke(Method.java:606)=5B:1.7.0=5F60-ea=5D =20 at =20 org.apache.aries.blueprint.utils.ReflectionUtils.invoke(ReflectionUtils.j= ava:297) =20 at =20 org.apache.aries.blueprint.container.BeanRecipe.invoke(BeanRecipe.java:95= 8) =20 at =20 org.apache.aries.blueprint.container.BeanRecipe.runBeanProcInit(BeanRecip= e.java:712) =20 --557a60d1_7c3dbd3d_13c--