I'm attempting to hot deploy a Camel route using the ActiveMQComponent into Karaf via the deploy folder using a blueprint xml file but I'm running into dependency issues. When Karaf attempts to start the created bundle I see this error:

2014-01-22 13:41:51,092 | ERROR | -SNAPSHOT/deploy | BlueprintContainerImpl     
      | 4 - org.apache.aries.blueprint.core - 1.3.0 | Unable to start blueprint 
container for bundle blueprint.xml
org.osgi.service.blueprint.container.ComponentDefinitionException: Unable to 
instantiate components
        at 
org.apache.aries.blueprint.container.BlueprintContainerImpl.instantiateEagerComponents(BlueprintContainerImpl.java:685)[4:org.apache.aries.blueprint.core:1.3.0]
        at 
org.apache.aries.blueprint.container.BlueprintContainerImpl.doRun(BlueprintContainerImpl.java:378)[4:org.apache.aries.blueprint.core:1.3.0]
        at 
org.apache.aries.blueprint.container.BlueprintContainerImpl.run(BlueprintContainerImpl.java:269)[4:org.apache.aries.blueprint.core:1.3.0]
        at 
org.apache.aries.blueprint.container.BlueprintExtender.createContainer(BlueprintExtender.java:276)[4:org.apache.aries.blueprint.core:1.3.0]
        at 
org.apache.aries.blueprint.container.BlueprintExtender.createContainer(BlueprintExtender.java:245)[4:org.apache.aries.blueprint.core:1.3.0]
        at 
org.apache.aries.blueprint.container.BlueprintExtender.modifiedBundle(BlueprintExtender.java:235)[4:org.apache.aries.blueprint.core:1.3.0]
        at 
org.apache.aries.util.tracker.hook.BundleHookBundleTracker$Tracked.customizerModified(BundleHookBundleTracker.java:500)[2:org.apache.aries.util:1.1.0]
        at 
org.apache.aries.util.tracker.hook.BundleHookBundleTracker$Tracked.customizerModified(BundleHookBundleTracker.java:433)[2:org.apache.aries.util:1.1.0]
        at 
org.apache.aries.util.tracker.hook.BundleHookBundleTracker$AbstractTracked.track(BundleHookBundleTracker.java:725)[2:org.apache.aries.util:1.1.0]
        at 
org.apache.aries.util.tracker.hook.BundleHookBundleTracker$Tracked.bundleChanged(BundleHookBundleTracker.java:463)[2:org.apache.aries.util:1.1.0]
        at 
org.apache.aries.util.tracker.hook.BundleHookBundleTracker$BundleEventHook.event(BundleHookBundleTracker.java:422)[2:org.apache.aries.util:1.1.0]
        at 
org.apache.felix.framework.util.SecureAction.invokeBundleEventHook(SecureAction.java:1103)[org.apache.felix.framework-4.2.1.jar:]
        at 
org.apache.felix.framework.util.EventDispatcher.createWhitelistFromHooks(EventDispatcher.java:695)[org.apache.felix.framework-4.2.1.jar:]
        at 
org.apache.felix.framework.util.EventDispatcher.fireBundleEvent(EventDispatcher.java:483)[org.apache.felix.framework-4.2.1.jar:]
        at 
org.apache.felix.framework.Felix.fireBundleEvent(Felix.java:4403)[org.apache.felix.framework-4.2.1.jar:]
        at 
org.apache.felix.framework.Felix.startBundle(Felix.java:2092)[org.apache.felix.framework-4.2.1.jar:]
        at 
org.apache.felix.framework.BundleImpl.start(BundleImpl.java:955)[org.apache.felix.framework-4.2.1.jar:]
        at 
org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundle(DirectoryWatcher.java:1247)[16:org.apache.felix.fileinstall:3.2.6]
        at 
org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundles(DirectoryWatcher.java:1219)[16:org.apache.felix.fileinstall:3.2.6]
        at 
org.apache.felix.fileinstall.internal.DirectoryWatcher.startAllBundles(DirectoryWatcher.java:1208)[16:org.apache.felix.fileinstall:3.2.6]
        at 
org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:503)[16:org.apache.felix.fileinstall:3.2.6]
        at 
org.apache.felix.fileinstall.internal.DirectoryWatcher.run(DirectoryWatcher.java:291)[16:org.apache.felix.fileinstall:3.2.6]
Caused by: java.lang.NoClassDefFoundError: 
org/apache/camel/spi/EndpointCompleter
        at java.lang.ClassLoader.defineClass1(Native Method)[:1.7.0_45]
        at java.lang.ClassLoader.defineClass(ClassLoader.java:800)[:1.7.0_45]
        at 
org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.findClass(BundleWiringImpl.java:2279)
        at 
org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1501)
        at 
org.apache.felix.framework.BundleWiringImpl.access$400(BundleWiringImpl.java:75)
        at 
org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:1955)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:358)[:1.7.0_45]
        at 
org.apache.felix.framework.BundleWiringImpl.getClassByDelegation(BundleWiringImpl.java:1374)
        at 
org.apache.felix.framework.BundleWiringImpl.searchImports(BundleWiringImpl.java:1553)
        at 
org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1484)
        at 
org.apache.felix.framework.BundleWiringImpl.access$400(BundleWiringImpl.java:75)
        at 
org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:1955)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:358)[:1.7.0_45]
        at 
org.apache.felix.framework.Felix.loadBundleClass(Felix.java:1844)[org.apache.felix.framework-4.2.1.jar:]
        at 
org.apache.felix.framework.BundleImpl.loadClass(BundleImpl.java:937)[org.apache.felix.framework-4.2.1.jar:]
        at 
org.apache.aries.blueprint.container.BlueprintContainerImpl.loadClass(BlueprintContainerImpl.java:432)[4:org.apache.aries.blueprint.core:1.3.0]
        at 
org.apache.aries.blueprint.container.BlueprintRepository.loadClass(BlueprintRepository.java:410)[4:org.apache.aries.blueprint.core:1.3.0]
        at 
org.apache.aries.blueprint.container.GenericType.parse(GenericType.java:113)
        at 
org.apache.aries.blueprint.di.AbstractRecipe.doLoadType(AbstractRecipe.java:168)[4:org.apache.aries.blueprint.core:1.3.0]
        at 
org.apache.aries.blueprint.di.AbstractRecipe.loadType(AbstractRecipe.java:161)[4:org.apache.aries.blueprint.core:1.3.0]
        at 
org.apache.aries.blueprint.container.BeanRecipe.loadClass(BeanRecipe.java:249)
        at 
org.apache.aries.blueprint.container.BeanRecipe.getType(BeanRecipe.java:895)
        at 
org.apache.aries.blueprint.container.BeanRecipe.getInstance(BeanRecipe.java:323)
        at 
org.apache.aries.blueprint.container.BeanRecipe.internalCreate2(BeanRecipe.java:806)
        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_45]
        at 
org.apache.aries.blueprint.di.AbstractRecipe.create(AbstractRecipe.java:88)[4:org.apache.aries.blueprint.core:1.3.0]
        at 
org.apache.aries.blueprint.container.BlueprintRepository.createInstances(BlueprintRepository.java:245)[4:org.apache.aries.blueprint.core:1.3.0]
        at 
org.apache.aries.blueprint.container.BlueprintRepository.createAll(BlueprintRepository.java:183)[4:org.apache.aries.blueprint.core:1.3.0]
        at 
org.apache.aries.blueprint.container.BlueprintContainerImpl.instantiateEagerComponents(BlueprintContainerImpl.java:681)[4:org.apache.aries.blueprint.core:1.3.0]
        ... 21 more
Caused by: java.lang.ClassNotFoundException: 
org.apache.camel.spi.EndpointCompleter not found by 
org.apache.activemq.activemq-web-console [175]
        at 
org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1532)[org.apache.felix.framework-4.2.1.jar:]
        at 
org.apache.felix.framework.BundleWiringImpl.access$400(BundleWiringImpl.java:75)[org.apache.felix.framework-4.2.1.jar:]
        at 
org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:1955)[org.apache.felix.framework-4.2.1.jar:]
        at java.lang.ClassLoader.loadClass(ClassLoader.java:358)[:1.7.0_45]
        ... 52 more

I've narrowed it down to instantiating the ActiveMQComponent bean as the cause of the error. Also, I've verified that the camel-core bundle is present, active, and contains org.apache.camel.spi.EndpointCompleter. Any idea why it can't find the class?

Version Detail: ActiveMQ 5.9.0, Camel 2.12.2, Karaf 3.0.0
blueprint.xml for reference:

<?xml version="1.0" encoding="UTF-8"?>
<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
    xmlns:camel="http://camel.apache.org/schema/blueprint";
    xsi:schemaLocation="
        http://www.osgi.org/xmlns/blueprint/v1.0.0 
http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd
        http://camel.apache.org/schema/blueprint 
http://camel.apache.org/schema/blueprint/camel-blueprint.xsd
    ">

  <bean id="connectionFactory" 
class="org.apache.activemq.ActiveMQConnectionFactory">
    <property name="brokerURL" value="tcp://localhost:61616"/>
  </bean>

  <bean id="activemq" 
class="org.apache.activemq.camel.component.ActiveMQComponent">
    <property name="connectionFactory" ref="connectionFactory"/>
  </bean>

  <bean id="helloBean" class="com.company.test.integ.beans.HelloBean"/>

  <camelContext xmlns="http://camel.apache.org/schema/blueprint"; id="camel">
    <route>
      <from 
uri="cxfrs://http://0.0.0.0:8080/rest?resourceClasses=com.company.test.integ.rest.HelloService&amp;bindingStyle=SimpleConsumer"/>
      <setExchangePattern pattern="InOut"/>
      <to uri="log:com.company.test.integ?level=INFO&amp;showAll=true"/>
      <to uri="activemq:queue:test"/>
    </route>
    <route>
      <from uri="activemq:queue:test"/>
      <setExchangePattern pattern="InOut"/>
      <to uri="log:com.company.test.integ?level=INFO&amp;showAll=true"/>
      <choice>
        <when>
          <simple>${header.operationName} == 'hello'</simple>
          <to uri="bean:helloBean?method=hello"/>
        </when>
        <otherwise>
          <log message="Bad operationName: ${header.operationName}"/>
        </otherwise>
      </choice>
      <to uri="log:com.company.test.integ?level=INFO&amp;showAll=true"/>
    </route>
  </camelContext>

</blueprint>

Thanks,
-Chris

Reply via email to