John, 

Would you be able to post how the service is being declared along with the 
service properties to ensure the correct service is being referenced in your 
consumer blueprint.

Thanks,
Andy

-- 
Andrew Block
On June 11, 2015 at 5:28:54 PM, John Dubchak (j...@johndubchak.com) wrote:

Hi,  

I have a service component, deployed as a separate bundle, that exports  
a package, com.example.services.configuration, and a service that  
implements a ConfigurationService interface in another package called  
LocalService:  

com.example.services.configruation.ConfigurationService  
com.example.services.configruation.local.LocalConfigurationService  

Another bundle imports the service using a filter (from the blueprint XML):  

<reference id="configurationService"  
interface="com.castlighthealth.services.configuration.ConfigurationService"  
filter="(realm=local)"/>  

and sets it as a property on a route bean. When I start this second  
bundle in ServiceMix I am getting a stacktrace [1] and just can't seem  
to figure out what I am doing wrong. Any guidance is very much appreciated.  

John  

[1]  
2015-06-11 21:59:41,641 | ERROR | Thread-58 |  
BlueprintContainerImpl | ? ?  
| 7 - org.apache.aries.blueprint.core - 1.4.0 | Unable to start  
blueprint container for bundle my-process-router  
org.osgi.service.blueprint.container.ComponentDefinitionException:  
Unable to initialize bean .camelBlueprint.factory.eventRouterContext  
at  
org.apache.aries.blueprint.container.BeanRecipe.runBeanProcInit(BeanRecipe.java:714)
  
at  
org.apache.aries.blueprint.container.BeanRecipe.internalCreate2(BeanRecipe.java:824)
  
at  
org.apache.aries.blueprint.container.BeanRecipe.internalCreate(BeanRecipe.java:787)
  
at  
org.apache.aries.blueprint.di.AbstractRecipe$1.call(AbstractRecipe.java:79)  
at  
java.util.concurrent.FutureTask.run(FutureTask.java:262)[:1.7.0_60-ea]  
at  
org.apache.aries.blueprint.di.AbstractRecipe.create(AbstractRecipe.java:88)  
at  
org.apache.aries.blueprint.container.BlueprintRepository.createInstances(BlueprintRepository.java:245)
  
at  
org.apache.aries.blueprint.container.BlueprintRepository.createInstance(BlueprintRepository.java:230)
  
at  
org.apache.aries.blueprint.container.BlueprintRepository.create(BlueprintRepository.java:145)
  
at  
org.apache.aries.blueprint.container.BlueprintContainerImpl.getComponentInstance(BlueprintContainerImpl.java:753)
  
at  
org.apache.camel.blueprint.handler.CamelNamespaceHandler$CamelDependenciesFinder.process(CamelNamespaceHandler.java:863)
  
at  
org.apache.aries.blueprint.container.BlueprintContainerImpl.processProcessors(BlueprintContainerImpl.java:528)
  
at  
org.apache.aries.blueprint.container.BlueprintContainerImpl.doRun(BlueprintContainerImpl.java:361)
  
at  
org.apache.aries.blueprint.container.BlueprintContainerImpl.run(BlueprintContainerImpl.java:269)
  
at  
org.apache.aries.blueprint.container.BlueprintExtender.createContainer(BlueprintExtender.java:276)
  
at  
org.apache.aries.blueprint.container.BlueprintExtender.createContainer(BlueprintExtender.java:245)
  
at  
org.apache.aries.blueprint.container.BlueprintExtender.modifiedBundle(BlueprintExtender.java:235)
  
at  
org.apache.aries.util.tracker.hook.BundleHookBundleTracker$Tracked.customizerModified(BundleHookBundleTracker.java:500)
  
at  
org.apache.aries.util.tracker.hook.BundleHookBundleTracker$Tracked.customizerModified(BundleHookBundleTracker.java:433)
  
at  
org.apache.aries.util.tracker.hook.BundleHookBundleTracker$AbstractTracked.track(BundleHookBundleTracker.java:725)
  
at  
org.apache.aries.util.tracker.hook.BundleHookBundleTracker$Tracked.bundleChanged(BundleHookBundleTracker.java:463)
  
at  
org.apache.aries.util.tracker.hook.BundleHookBundleTracker$BundleEventHook.event(BundleHookBundleTracker.java:422)
  
at  
org.apache.felix.framework.util.SecureAction.invokeBundleEventHook(SecureAction.java:1103)
  
at  
org.apache.felix.framework.util.EventDispatcher.createWhitelistFromHooks(EventDispatcher.java:695)
  
at  
org.apache.felix.framework.util.EventDispatcher.fireBundleEvent(EventDispatcher.java:483)
  
at  
org.apache.felix.framework.Felix.fireBundleEvent(Felix.java:4244)  
at org.apache.felix.framework.Felix.startBundle(Felix.java:1923)  
at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:944)  
at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:931)  
at  
org.apache.karaf.shell.osgi.StartBundle.doExecute(StartBundle.java:37)  
at  
org.apache.karaf.shell.osgi.BundlesCommand.doExecute(BundlesCommand.java:37)  
at  
org.apache.karaf.shell.console.OsgiCommandSupport.execute(OsgiCommandSupport.java:38)[15:org.apache.karaf.shell.console:2.3.4]
  
at  
org.apache.felix.gogo.commands.basic.AbstractCommand.execute(AbstractCommand.java:35)[15:org.apache.karaf.shell.console:2.3.4]
  
at  
org.apache.felix.gogo.runtime.CommandProxy.execute(CommandProxy.java:78)[15:org.apache.karaf.shell.console:2.3.4]
  
at  
org.apache.felix.gogo.runtime.Closure.executeCmd(Closure.java:474)[15:org.apache.karaf.shell.console:2.3.4]
  
at  
org.apache.felix.gogo.runtime.Closure.executeStatement(Closure.java:400)[15:org.apache.karaf.shell.console:2.3.4]
  
at  
org.apache.felix.gogo.runtime.Pipe.run(Pipe.java:108)[15:org.apache.karaf.shell.console:2.3.4]
  
at  
org.apache.felix.gogo.runtime.Closure.execute(Closure.java:183)[15:org.apache.karaf.shell.console:2.3.4]
  
at  
org.apache.felix.gogo.runtime.Closure.execute(Closure.java:120)[15:org.apache.karaf.shell.console:2.3.4]
  
at  
org.apache.felix.gogo.runtime.CommandSessionImpl.execute(CommandSessionImpl.java:89)
  
at  
org.apache.karaf.shell.console.jline.Console.run(Console.java:183)  
at java.lang.Thread.run(Thread.java:744)[:1.7.0_60-ea]  
at  
org.apache.karaf.shell.ssh.ShellFactoryImpl$ShellImpl$4.doRun(ShellFactoryImpl.java:144)[47:org.apache.karaf.shell.ssh:2.3.4]
  
at  
org.apache.karaf.shell.ssh.ShellFactoryImpl$ShellImpl$4$1.run(ShellFactoryImpl.java:135)
  
at java.security.AccessController.doPrivileged(Native  
Method)[:1.7.0_60-ea]  
at javax.security.auth.Subject.doAs(Subject.java:356)[:1.7.0_60-ea]  
at  
org.apache.karaf.shell.ssh.ShellFactoryImpl$ShellImpl$4.run(ShellFactoryImpl.java:133)[47:org.apache.karaf.shell.ssh:2.3.4]
  
Caused by: java.lang.ClassCastException:  
com.example.services.configuration.local.LocalConfigurationService  
cannot be cast to com.example.services.configuration.ConfigurationService  
at  
Proxy5216067d_ed21_408f_b02b_9397ef0efbb3.getCurrentConfiguration(Unknown 
Source)  
at  
com.example.services.routes.ConfigurableEndpointPair.getConfiguration(ConfigurableEndpointPair.java:24)
  
at  
com.example.services.routes.ConfigurableEndpointPair.getInbound(ConfigurableEndpointPair.java:53)
  
at  
com.example.services.routes.EventRoute.configure(EventRoute.java:55)  
at  
org.apache.camel.builder.RouteBuilder.checkInitialized(RouteBuilder.java:322)  
at  
org.apache.camel.builder.RouteBuilder.configureRoutes(RouteBuilder.java:276)  
at  
org.apache.camel.builder.RouteBuilder.addRoutesToCamelContext(RouteBuilder.java:262)
  
at  
org.apache.camel.impl.DefaultCamelContext.addRoutes(DefaultCamelContext.java:679)
  
at  
org.apache.camel.core.xml.AbstractCamelContextFactoryBean.installRoutes(AbstractCamelContextFactoryBean.java:761)
  
at  
org.apache.camel.core.xml.AbstractCamelContextFactoryBean.setupRoutes(AbstractCamelContextFactoryBean.java:311)
  
at  
org.apache.camel.blueprint.CamelContextFactoryBean.afterPropertiesSet(CamelContextFactoryBean.java:304)
  
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native  
Method)[:1.7.0_60-ea]  
at  
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)[:1.7.0_60-ea]
  
at  
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[:1.7.0_60-ea]
  
at java.lang.reflect.Method.invoke(Method.java:606)[:1.7.0_60-ea]  
at  
org.apache.aries.blueprint.utils.ReflectionUtils.invoke(ReflectionUtils.java:297)
  
at  
org.apache.aries.blueprint.container.BeanRecipe.invoke(BeanRecipe.java:958)  
at  
org.apache.aries.blueprint.container.BeanRecipe.runBeanProcInit(BeanRecipe.java:712)
  


Reply via email to