0

I'm starting pretty simple camel-blueprint project, it works fine (or something like fine) in karaf (servicemix), but in order to develop and debug on my machine i want to integrate it with camel-maven-plugin.

My blueprint looks like that:

<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"
       xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.1.0"
       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/spring/camel-blueprint.xsd">

    <cm:property-placeholder persistent-id="ru.igc.igsb" update-strategy="reload">
        <cm:default-properties>
            <cm:property name="csvPath" value="C:/files"/>
        </cm:default-properties>
    </cm:property-placeholder>

    <camelContext xmlns="http://camel.apache.org/schema/blueprint">
        <route>
            <from uri="file:{{csvPath}}"/>
            <log message="The message contains ${body}"/>
        </route>
    </camelContext>

</blueprint>

my pom have this:

 <plugin>
    <groupId>org.apache.camel</groupId>
    <artifactId>camel-maven-plugin</artifactId>
    <!-- optional, default value: org.apache.camel.spring.Main -->
    <configuration>
      <useBlueprint>true</useBlueprint>
    </configuration>
  </plugin>

but camel:run fails:

EventDispatcher: Error during dispatch.
org.osgi.framework.ServiceException: Service factory exception: java.lang.AbstractMethodError: org.apache.aries.proxy.impl.JdkProxyManager.createProxy(Lorg/osgi/framework/Bundle;Ljava/util/Collection;Ljava/util/concurrent/Callable;)Ljava/lang/Object;
    at de.kalpatec.pojosr.framework.felix.framework.ServiceRegistrationImpl.getFactoryUnchecked(ServiceRegistrationImpl.java:236)
    at de.kalpatec.pojosr.framework.felix.framework.ServiceRegistrationImpl.getService(ServiceRegistrationImpl.java:168)
    at de.kalpatec.pojosr.framework.felix.framework.ServiceRegistry.getService(ServiceRegistry.java:308)
    at de.kalpatec.pojosr.framework.PojoSRBundleContext.getService(PojoSRBundleContext.java:156)
    at org.apache.aries.blueprint.namespace.NamespaceHandlerRegistryImpl.addingService(NamespaceHandlerRegistryImpl.java:90)
    at org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:896)
    at org.osgi.util.tracker.AbstractTracked.trackAdding(AbstractTracked.java:261)
    at org.osgi.util.tracker.AbstractTracked.track(AbstractTracked.java:233)
    at org.osgi.util.tracker.ServiceTracker$Tracked.serviceChanged(ServiceTracker.java:840)
    at de.kalpatec.pojosr.framework.felix.framework.util.EventDispatcher.invokeServiceListenerCallback(EventDispatcher.java:872)
    at de.kalpatec.pojosr.framework.felix.framework.util.EventDispatcher.fireEventImmediately(EventDispatcher.java:792)
    at de.kalpatec.pojosr.framework.felix.framework.util.EventDispatcher.fireServiceEvent(EventDispatcher.java:540)
    at de.kalpatec.pojosr.framework.PojoSR$1.serviceChanged(PojoSR.java:66)
    at de.kalpatec.pojosr.framework.felix.framework.ServiceRegistry.registerService(ServiceRegistry.java:116)
    at de.kalpatec.pojosr.framework.PojoSRBundleContext.registerService(PojoSRBundleContext.java:95)
    at org.apache.aries.blueprint.container.BlueprintContainerImpl.registerService(BlueprintContainerImpl.java:404)
    at org.apache.aries.blueprint.container.ServiceRecipe.register(ServiceRecipe.java:184)
    at org.apache.aries.blueprint.container.BlueprintContainerImpl.registerServices(BlueprintContainerImpl.java:662)
    at org.apache.aries.blueprint.container.BlueprintContainerImpl.doRun(BlueprintContainerImpl.java:330)
    at org.apache.aries.blueprint.container.BlueprintContainerImpl.run(BlueprintContainerImpl.java:227)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
    at java.util.concurrent.FutureTask.run(FutureTask.java:166)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:178)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:292)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
    at java.lang.Thread.run(Thread.java:722)
Caused by: org.osgi.service.blueprint.container.ComponentDefinitionException: java.lang.AbstractMethodError: org.apache.aries.proxy.impl.JdkProxyManager.createProxy(Lorg/osgi/framework/Bundle;Ljava/util/Collection;Ljava/util/concurrent/Callable;)Ljava/lang/Object;
    at org.apache.aries.blueprint.container.ReferenceRecipe.internalCreate(ReferenceRecipe.java:98)
    at org.apache.aries.blueprint.di.AbstractRecipe.create(AbstractRecipe.java:64)
    at org.apache.aries.blueprint.container.BeanRecipe.setProperty(BeanRecipe.java:799)
    at org.apache.aries.blueprint.container.BeanRecipe.setProperties(BeanRecipe.java:773)
    at org.apache.aries.blueprint.container.BeanRecipe.setProperties(BeanRecipe.java:754)
    at org.apache.aries.blueprint.container.BeanRecipe.internalCreate(BeanRecipe.java:720)
    at org.apache.aries.blueprint.di.AbstractRecipe.create(AbstractRecipe.java:64)
    at org.apache.aries.blueprint.container.BlueprintRepository.createInstances(BlueprintRepository.java:219)
    at org.apache.aries.blueprint.container.BlueprintRepository.createInstance(BlueprintRepository.java:198)
    at org.apache.aries.blueprint.container.BlueprintRepository.create(BlueprintRepository.java:137)
    at org.apache.aries.blueprint.container.ServiceRecipe.createRecipe(ServiceRecipe.java:370)
    at org.apache.aries.blueprint.container.ServiceRecipe.createService(ServiceRecipe.java:278)
    at org.apache.aries.blueprint.container.ServiceRecipe.internalGetService(ServiceRecipe.java:248)
    at org.apache.aries.blueprint.container.ServiceRecipe.getService(ServiceRecipe.java:327)
    at org.apache.aries.blueprint.container.ServiceRecipe$TriggerServiceFactory.getService(ServiceRecipe.java:430)
    at de.kalpatec.pojosr.framework.felix.framework.ServiceRegistrationImpl.getFactoryUnchecked(ServiceRegistrationImpl.java:232)
    ... 27 more
Caused by: java.lang.AbstractMethodError: org.apache.aries.proxy.impl.JdkProxyManager.createProxy(Lorg/osgi/framework/Bundle;Ljava/util/Collection;Ljava/util/concurrent/Callable;)Ljava/lang/Object;
    at org.apache.aries.blueprint.container.AbstractServiceReferenceRecipe.createProxy(AbstractServiceReferenceRecipe.java:236)
    at org.apache.aries.blueprint.container.ReferenceRecipe.internalCreate(ReferenceRecipe.java:82)
    ... 42 more
[ERROR] *************************************
[ERROR] Error occurred while running main from: org.apache.camel.test.blueprint.Main
[ERROR] 

2 Answers 2

1

Probably there's a missing dependency (see https://issues.apache.org/jira/browse/CAMEL-9321).

Solution

Add

<dependency>
    <groupId>org.apache.aries.blueprint</groupId>
    <artifactId>org.apache.aries.blueprint.core</artifactId>
</dependency>

into the dependencies-Section of your pom.xml (root directory, not the derived pom.xml under /bin).

Hope this helps.

0

I have just used the camel sample from ServiceMix 5.4.x (https://github.com/apache/servicemix/tree/servicemix-5.4.x/examples/camel/camel-blueprint), replaced the existing blueprint with yours and added the plugin to pom file

<plugin>
    <groupId>org.apache.camel</groupId>
    <artifactId>camel-maven-plugin</artifactId>
    <version>2.14.1</version>
    <!-- optional, default value: org.apache.camel.spring.Main -->
    <configuration>
      <useBlueprint>true</useBlueprint>
    </configuration>
</plugin>

It worked for me. Please compare your project (especially the pom file) with the sample project. Be sure you use the same camel and camel plugin version.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.