camel-cxf,blueprint和cxfrsEndpoint bindingStyles

时间:2014-07-13 18:34:36

标签: apache-camel cxfrs blueprint

我尝试用camel:cxfrs打开休息服务。实际上,它只能在默认的bindingStyle中工作。我不想管理MessageContentsList。所以就像记录一样,我使用了SimpleConsumer bindingStyle。

但是当我在karaf(2.3.5)中部署我的bundle时,会发生NotClassDefFoundError(SimpleCxfRsBinding)。我确切地说我在骆驼-2.12.2。

blueprint.xml:

<camel:from uri="cxfrs:///test?resourceClasses=application.Resource&amp;loggingFeatureEnabled=true&amp;bindingStyle=SimpleConsumer"/>

(编辑)karaf.log:

ERROR: Bundle blueprint-contract-first [403] EventDispatcher: Error during dispatch. (java.lang.NoClassDefFoundError: Could not initialize class org.apache.came l.component.cxf.jaxrs.SimpleCxfRsBinding) java.lang.NoClassDefFoundError: Could not initialize class org.apache.camel.component.cxf.jaxrs.SimpleCxfRsBinding 
at org.apache.camel.component.cxf.jaxrs.CxfRsEndpoint.doStart(CxfRsEndpoint.java:477) 
at org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:61) 
at org.apache.camel.impl.DefaultCamelContext.startService(DefaultCamelContext.java:1929) 
at org.apache.camel.impl.DefaultCamelContext.doAddService(DefaultCamelContext.java:987) 
at org.apache.camel.impl.DefaultCamelContext.addService(DefaultCamelContext.java:948) 
at org.apache.camel.impl.DefaultCamelContext.getEndpoint(DefaultCamelContext.java:527) 
at org.apache.camel.util.CamelContextHelper.getMandatoryEndpoint(CamelContextHelper.java:71) 
at org.apache.camel.model.RouteDefinition.resolveEndpoint(RouteDefinition.java:192) 
at org.apache.camel.impl.DefaultRouteContext.resolveEndpoint(DefaultRouteContext.java:106) 
at org.apache.camel.impl.DefaultRouteContext.resolveEndpoint(DefaultRouteContext.java:112) 
at org.apache.camel.model.FromDefinition.resolveEndpoint(FromDefinition.java:72) 
at org.apache.camel.impl.DefaultRouteContext.getEndpoint(DefaultRouteContext.java:88) 
at org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:890) 
at org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:177) 
at org.apache.camel.impl.DefaultCamelContext.startRoute(DefaultCamelContext.java:778) 
at org.apache.camel.impl.DefaultCamelContext.startRouteDefinitions(DefaultCamelContext.java:1955) 
at org.apache.camel.impl.DefaultCamelContext.doStartCamel(DefaultCamelContext.java:1705) 
at org.apache.camel.impl.DefaultCamelContext.doStart(DefaultCamelContext.java:1579) 
at org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:61) 
at org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:1547) 
at org.apache.camel.blueprint.BlueprintCamelContext.start(BlueprintCamelContext.java:177) 
at org.apache.camel.blueprint.BlueprintCamelContext.maybeStart(BlueprintCamelContext.java:209) 
at org.apache.camel.blueprint.BlueprintCamelContext.serviceChanged(BlueprintCamelContext.java:147) 
at org.apache.felix.framework.util.EventDispatcher.invokeServiceListenerCallback(EventDispatcher.java:932) 
at org.apache.felix.framework.util.EventDispatcher.fireEventImmediately(EventDispatcher.java:793) 
at org.apache.felix.framework.util.EventDispatcher.fireServiceEvent(EventDispatcher.java:543) at org.apache.felix.framework.Felix.fireServiceEvent(Felix.java:4260) 
at org.apache.felix.framework.Felix.registerService(Felix.java:3275) 
at org.apache.felix.framework.BundleContextImpl.registerService(BundleContextImpl.java:346) 
at org.apache.felix.framework.BundleContextImpl.registerService(BundleContextImpl.java:352) 
at org.apache.camel.blueprint.BlueprintCamelContext.init(BlueprintCamelContext.java:97) 
at sun.reflect.GeneratedMethodAccessor58.invoke(Unknown Source) 
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) 
at java.lang.reflect.Method.invoke(Method.java:597) 
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) 
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$Sync.innerRun(FutureTask.java:303) 
at java.util.concurrent.FutureTask.run(FutureTask.java:138) 
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.createAll(BlueprintRepository.java:183) 
at org.apache.aries.blueprint.container.BlueprintContainerImpl.instantiateEagerComponents(BlueprintContainerImpl.java:681) 
at org.apache.aries.blueprint.container.BlueprintContainerImpl.doRun(BlueprintContainerImpl.java:378) 
at org.apache.aries.blueprint.container.BlueprintContainerImpl.run(BlueprintContainerImpl.java:269) 
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:439) 
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) 
at java.util.concurrent.FutureTask.run(FutureTask.java:138) 
at org.apache.aries.blueprint.container.ExecutorServiceWrapper.run(ExecutorServiceWrapper.java:106) 
at org.apache.aries.blueprint.utils.threading.impl.DiscardableRunnable.run(DiscardableRunnable.java:48) 
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:439) 
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) 
at java.util.concurrent.FutureTask.run(FutureTask.java:138) 
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:98) 
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:206) 
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895) 
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918) 
at java.lang.Thread.run(Thread.java:662)

有没有人在蓝图中使用SimpleConsumer的cxfrs工作示例?我错过了什么吗?

1 个答案:

答案 0 :(得分:0)

这是Karaf的无效版本。用cxf / 2.7.11进行全新安装后,使用karaf / 3.0.1中的camel / 2.13.2。它运作得很好。