如何在卡拉夫中结合ActiveMQ使用Camel蓝图

8aqjt8rx  于 2023-03-12  发布在  Apache
关注(0)|答案(1)|浏览(154)

我试着在下面写一个蓝图,但是它不起作用。请协助,它有什么问题吗?
我的配置如下:

  • 卡拉夫4.4.3
  • Camel 3.20.2
  • 动态MQ 5.16.6
<?xml version="1.0" encoding="UTF-8"?>
<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0">
    
    <bean id="activemq" class="org.apache.activemq.camel.component.ActiveMQComponent">
        <property name="brokerURL" value="tcp://localhost:61616" />
    </bean>
      
    <camelContext xmlns="http://camel.apache.org/schema/blueprint">
        <route>
            <from uri="activemq:kafka.incoming"/>
            <to uri="activemq:quickfixj.incoming"/>            
        </route>
        
        <route>
            <from uri="activemq:quickfixj.outgoing"/>
            <to uri="activemq:kafka"/>                
        </route>
        
        <route>
            <from uri="activemq:kafka"/>                        
            <to uri="activemq:kafka.outgoing"/>
        </route>
    </camelContext>
</blueprint>

下面是我将以前的蓝图文件复制到../deploy文件夹时遇到的异常。

2023-03-02T12:40:10,962 | WARN  | fileinstall-/opt/krf/apache-karaf-4.4.3/deploy | BlueprintEventDispatcher         | 85 - org.apache.aries.blueprint.core - 1.10.3 | Listener caused an exception, will be ignored
java.util.concurrent.ExecutionException: java.lang.NoClassDefFoundError: org/apache/camel/util/IntrospectionSupport
        at java.util.concurrent.FutureTask.report(FutureTask.java:122) ~[?:?]
        at java.util.concurrent.FutureTask.get(FutureTask.java:191) ~[?:?]
        at java.util.concurrent.AbstractExecutorService.doInvokeAny(AbstractExecutorService.java:204) ~[?:?]
        at java.util.concurrent.AbstractExecutorService.invokeAny(AbstractExecutorService.java:235) ~[?:?]
        at org.apache.aries.blueprint.utils.threading.ScheduledExecutorServiceWrapper$4.call(ScheduledExecutorServiceWrapper.java:185) ~[?:?]
        at org.apache.aries.blueprint.utils.threading.ScheduledExecutorServiceWrapper$15.call(ScheduledExecutorServiceWrapper.java:446) ~[?:?]
        at org.apache.aries.blueprint.utils.threading.RWLock.runReadOperation(RWLock.java:33) ~[?:?]
        at org.apache.aries.blueprint.utils.threading.ScheduledExecutorServiceWrapper.runUnlessShutdown(ScheduledExecutorServiceWrapper.java:443) ~[?:?]
        at org.apache.aries.blueprint.utils.threading.ScheduledExecutorServiceWrapper.invokeAny(ScheduledExecutorServiceWrapper.java:180) ~[?:?]
        at org.apache.aries.blueprint.container.BlueprintEventDispatcher.callListener(BlueprintEventDispatcher.java:195) ~[?:?]
        at org.apache.aries.blueprint.container.BlueprintEventDispatcher.callListeners(BlueprintEventDispatcher.java:178) ~[?:?]
        at org.apache.aries.blueprint.container.BlueprintEventDispatcher.blueprintEvent(BlueprintEventDispatcher.java:133) ~[?:?]
        at org.apache.aries.blueprint.container.BlueprintContainerImpl.doRun(BlueprintContainerImpl.java:447) ~[?:?]
        at org.apache.aries.blueprint.container.BlueprintContainerImpl.run(BlueprintContainerImpl.java:298) ~[?:?]
        at org.apache.aries.blueprint.container.BlueprintExtender.createContainer(BlueprintExtender.java:335) ~[?:?]
        at org.apache.aries.blueprint.container.BlueprintExtender.createContainer(BlueprintExtender.java:288) ~[?:?]
        at org.apache.aries.blueprint.container.BlueprintExtender.createContainer(BlueprintExtender.java:284) ~[?:?]
        at org.apache.aries.blueprint.container.BlueprintExtender.modifiedBundle(BlueprintExtender.java:274) ~[?:?]
        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:1384) ~[?:?]
        at org.apache.felix.framework.EventDispatcher.createWhitelistFromHooks(EventDispatcher.java:730) ~[?:?]
        at org.apache.felix.framework.EventDispatcher.fireBundleEvent(EventDispatcher.java:485) ~[?:?]
        at org.apache.felix.framework.Felix.fireBundleEvent(Felix.java:4847) ~[?:?]
        at org.apache.felix.framework.Felix.startBundle(Felix.java:2363) ~[?:?]
        at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:1006) ~[?:?]
        at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundle(DirectoryWatcher.java:1260) ~[?:?]
        at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundles(DirectoryWatcher.java:1233) ~[?:?]
        at org.apache.felix.fileinstall.internal.DirectoryWatcher.startAllBundles(DirectoryWatcher.java:1221) ~[?:?]
        at org.apache.felix.fileinstall.internal.DirectoryWatcher.doProcess(DirectoryWatcher.java:515) ~[?:?]
        at org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:365) ~[?:?]
        at org.apache.felix.fileinstall.internal.DirectoryWatcher.run(DirectoryWatcher.java:316) ~[?:?]
Caused by: java.lang.NoClassDefFoundError: org/apache/camel/util/IntrospectionSupport
        at org.apache.activemq.camel.component.ActiveMQComponent.convertPathToActualDestination(ActiveMQComponent.java:161) ~[?:?]
        at org.apache.camel.component.jms.JmsComponent.createEndpoint(JmsComponent.java:1117) ~[?:?]
        at org.apache.camel.support.DefaultComponent.createEndpoint(DefaultComponent.java:171) ~[?:?]
        at org.apache.camel.impl.engine.AbstractCamelContext.doGetEndpoint(AbstractCamelContext.java:974) ~[?:?]
        at org.apache.camel.impl.engine.AbstractCamelContext.getEndpoint(AbstractCamelContext.java:890) ~[?:?]
        at org.apache.camel.support.CamelContextHelper.getMandatoryEndpoint(CamelContextHelper.java:62) ~[?:?]
        at org.apache.camel.reifier.AbstractReifier.resolveEndpoint(AbstractReifier.java:195) ~[?:?]
        at org.apache.camel.reifier.RouteReifier.doCreateRoute(RouteReifier.java:95) ~[?:?]
        at org.apache.camel.reifier.RouteReifier.createRoute(RouteReifier.java:75) ~[?:?]
        at org.apache.camel.impl.DefaultModelReifierFactory.createRoute(DefaultModelReifierFactory.java:49) ~[?:?]
        at org.apache.camel.impl.DefaultCamelContext.startRouteDefinitions(DefaultCamelContext.java:937) ~[?:?]
        at org.apache.camel.impl.DefaultCamelContext.startRouteDefinitions(DefaultCamelContext.java:800) ~[?:?]
        at org.apache.camel.impl.engine.AbstractCamelContext.doInit(AbstractCamelContext.java:3008) ~[?:?]
        at org.apache.camel.support.service.BaseService.init(BaseService.java:83) ~[?:?]
        at org.apache.camel.impl.engine.AbstractCamelContext.init(AbstractCamelContext.java:2679) ~[?:?]
        at org.apache.camel.support.service.BaseService.start(BaseService.java:111) ~[?:?]
        at org.apache.camel.impl.engine.AbstractCamelContext.start(AbstractCamelContext.java:2698) ~[?:?]
        at org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:262) ~[?:?]
        at org.apache.camel.blueprint.BlueprintCamelContext.start(BlueprintCamelContext.java:241) ~[?:?]
        at org.apache.camel.blueprint.BlueprintCamelContext.maybeStart(BlueprintCamelContext.java:283) ~[?:?]
        at org.apache.camel.blueprint.BlueprintCamelContext.blueprintEvent(BlueprintCamelContext.java:188) ~[?:?]
        at org.apache.aries.blueprint.container.BlueprintEventDispatcher$3.call(BlueprintEventDispatcher.java:197) ~[?:?]
        at org.apache.aries.blueprint.container.BlueprintEventDispatcher$3.call(BlueprintEventDispatcher.java:195) ~[?:?]
        at java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[?:?]
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539) ~[?:?]
        at java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[?:?]
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539) ~[?:?]
        at java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[?:?]
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304) ~[?:?]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) ~[?:?]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) ~[?:?]
        at java.lang.Thread.run(Thread.java:833) ~[?:?]
Caused by: java.lang.ClassNotFoundException: org.apache.camel.util.IntrospectionSupport not found by org.apache.camel.camel-util [185]
        at org.apache.activemq.camel.component.ActiveMQComponent.convertPathToActualDestination(ActiveMQComponent.java:161) ~[?:?]
        at org.apache.camel.component.jms.JmsComponent.createEndpoint(JmsComponent.java:1117) ~[?:?]
        at org.apache.camel.support.DefaultComponent.createEndpoint(DefaultComponent.java:171) ~[?:?]
        at org.apache.camel.impl.engine.AbstractCamelContext.doGetEndpoint(AbstractCamelContext.java:974) ~[?:?]
        at org.apache.camel.impl.engine.AbstractCamelContext.getEndpoint(AbstractCamelContext.java:890) ~[?:?]
        at org.apache.camel.support.CamelContextHelper.getMandatoryEndpoint(CamelContextHelper.java:62) ~[?:?]
        at org.apache.camel.reifier.AbstractReifier.resolveEndpoint(AbstractReifier.java:195) ~[?:?]
        at org.apache.camel.reifier.RouteReifier.doCreateRoute(RouteReifier.java:95) ~[?:?]
        at org.apache.camel.reifier.RouteReifier.createRoute(RouteReifier.java:75) ~[?:?]
        at org.apache.camel.impl.DefaultModelReifierFactory.createRoute(DefaultModelReifierFactory.java:49) ~[?:?]
        at org.apache.camel.impl.DefaultCamelContext.startRouteDefinitions(DefaultCamelContext.java:937) ~[?:?]
        at org.apache.camel.impl.DefaultCamelContext.startRouteDefinitions(DefaultCamelContext.java:800) ~[?:?]
        at org.apache.camel.impl.engine.AbstractCamelContext.doInit(AbstractCamelContext.java:3008) ~[?:?]
        at org.apache.camel.support.service.BaseService.init(BaseService.java:83) ~[?:?]
        at org.apache.camel.impl.engine.AbstractCamelContext.init(AbstractCamelContext.java:2679) ~[?:?]
        at org.apache.camel.support.service.BaseService.start(BaseService.java:111) ~[?:?]
        at org.apache.camel.impl.engine.AbstractCamelContext.start(AbstractCamelContext.java:2698) ~[?:?]
        at org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:262) ~[?:?]
        at org.apache.camel.blueprint.BlueprintCamelContext.start(BlueprintCamelContext.java:241) ~[?:?]
        at org.apache.camel.blueprint.BlueprintCamelContext.maybeStart(BlueprintCamelContext.java:283) ~[?:?]
        at org.apache.camel.blueprint.BlueprintCamelContext.blueprintEvent(BlueprintCamelContext.java:188) ~[?:?]
        at org.apache.aries.blueprint.container.BlueprintEventDispatcher$3.call(BlueprintEventDispatcher.java:197) ~[?:?]
        at org.apache.aries.blueprint.container.BlueprintEventDispatcher$3.call(BlueprintEventDispatcher.java:195) ~[?:?]
        at java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[?:?]
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539) ~[?:?]
        at java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[?:?]
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539) ~[?:?]
        at java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[?:?]
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304) ~[?:?]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) ~[?:?]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) ~[?:?]
        at java.lang.Thread.run(Thread.java:833) ~[?:?]
wlzqhblo

wlzqhblo1#

activemq-camel组件已弃用并删除。
这个类定义来自activemq-camel(请注意,在包名中,“activemq”位于“camel”之前)。

org.apache.activemq.camel.component.ActiveMQComponent

尝试更新以使用标准camel-jms或camel-activemq组件

相关问题