我正在尝试使用camel kafka创建一个包,并在servicemix中运行它。该模块是一个非常基本的Kafka使用者,它使用camel-kafka连接器,并使用来自Kafka主题的消息。我能够使用mvn成功地运行模块camel:run但是,在服务组合中安装与osgi捆绑包相同的模块会出现以下错误:
014-11-03 21:07:25,929 | ERROR | rint Extender: 1 | BlueprintContainerImpl | ? ? | 17 - org.apache.aries.blueprint.core - 1.4.1 | Unable to start blueprint container for bundle kafka-test due to unresolved dependencies [(&(component=kafka)(objectClass=org.apache.camel.spi.ComponentResolver))]
java.util.concurrent.TimeoutException
at org.apache.aries.blueprint.container.BlueprintContainerImpl$1.run(BlueprintContainerImpl.java:336)[17:org.apache.aries.blueprint.core:1.4.1]
at org.apache.aries.blueprint.utils.threading.impl.DiscardableRunnable.run(DiscardableRunnable.java:48)[17:org.apache.aries.blueprint.core:1.4.1]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)[:1.7.0_67]
at java.util.concurrent.FutureTask.run(FutureTask.java:262)[:1.7.0_67]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:178)[:1.7.0_67]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:292)[:1.7.0_67]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)[:1.7.0_67]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)[:1.7.0_67]
更新
在servicemix中安装camel-kafka特性后,上述警告得到了解决(多亏了阿希姆),然后我开始出现以下错误:
EventDispatcher: Error during dispatch. (java.lang.NoClassDefFoundError: org/I0Itec/zkclient/serialize/ZkSerializer)
java.lang.NoClassDefFoundError: org/I0Itec/zkclient/serialize/ZkSerializer
at kafka.javaapi.consumer.ZookeeperConsumerConnector.<init>(ZookeeperConsumerConnector.scala:65)
at kafka.javaapi.consumer.ZookeeperConsumerConnector.<init>(ZookeeperConsumerConnector.scala:67)
at kafka.consumer.Consumer$.createJavaConsumerConnector(ConsumerConnector.scala:100)
at kafka.consumer.Consumer.createJavaConsumerConnector(ConsumerConnector.scala)
at org.apache.camel.component.kafka.KafkaConsumer.doStart(KafkaConsumer.java:72)
at org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:61)
at org.apache.camel.impl.DefaultCamelContext.startService(DefaultCamelContext.java:2042)
at org.apache.camel.impl.DefaultCamelContext.doStartOrResumeRouteConsumers(DefaultCamelContext.java:2336)
at org.apache.camel.impl.DefaultCamelContext.doStartRouteConsumers(DefaultCamelContext.java:2272)
at org.apache.camel.impl.DefaultCamelContext.safelyStartRouteServices(DefaultCamelContext.java:2202)
at org.apache.camel.impl.DefaultCamelContext.doStartOrResumeRoutes(DefaultCamelContext.java:1981)
at org.apache.camel.impl.DefaultCamelContext.doStartCamel(DefaultCamelContext.java:1851)
at org.apache.camel.impl.DefaultCamelContext.doStart(DefaultCamelContext.java:1683)
at org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:61)
at org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:1651)
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:943)
at org.apache.felix.framework.util.EventDispatcher.fireEventImmediately(EventDispatcher.java:794)
at org.apache.felix.framework.util.EventDispatcher.fireServiceEvent(EventDispatcher.java:544)
at org.apache.felix.framework.Felix.fireServiceEvent(Felix.java:4445)
at org.apache.felix.framework.Felix.registerService(Felix.java:3431)
at org.apache.felix.framework.BundleContextImpl.registerService(BundleContextImpl.java:346)
at org.apache.felix.framework.BundleContextImpl.registerService(BundleContextImpl.java:353)
at org.apache.camel.blueprint.BlueprintCamelContext.init(BlueprintCamelContext.java:97)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
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.run(FutureTask.java:262)
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 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:1127)
at org.apache.felix.framework.util.EventDispatcher.createWhitelistFromHooks(EventDispatcher.java:696)
at org.apache.felix.framework.util.EventDispatcher.fireBundleEvent(EventDispatcher.java:484)
at org.apache.felix.framework.Felix.fireBundleEvent(Felix.java:4429)
at org.apache.felix.framework.Felix.startBundle(Felix.java:2100)
at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:976)
at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:963)
at org.apache.karaf.shell.osgi.InstallBundle.doExecute(InstallBundle.java:51)
at org.apache.karaf.shell.console.OsgiCommandSupport.execute(OsgiCommandSupport.java:38)
at org.apache.felix.gogo.commands.basic.AbstractCommand.execute(AbstractCommand.java:35)
at org.apache.felix.gogo.runtime.CommandProxy.execute(CommandProxy.java:78)
at org.apache.felix.gogo.runtime.Closure.executeCmd(Closure.java:477)
at org.apache.felix.gogo.runtime.Closure.executeStatement(Closure.java:403)
at org.apache.felix.gogo.runtime.Pipe.run(Pipe.java:108)
at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:183)
at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:120)
at org.apache.felix.gogo.runtime.CommandSessionImpl.execute(CommandSessionImpl.java:92)
at org.apache.karaf.shell.console.jline.Console.run(Console.java:196)
at org.apache.karaf.shell.console.jline.DelayedStarted.run(DelayedStarted.java:79)
Caused by: java.lang.ClassNotFoundException: org.I0Itec.zkclient.serialize.ZkSerializer not found by org.apache.servicemix.bundles.kafka_2.10 [217]
at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1556)
at org.apache.felix.framework.BundleWiringImpl.access$400(BundleWiringImpl.java:77)
at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:1993)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
... 70 more
我安装zkclient时使用osgi:install by 从maven存储库下载0.4和0.3jar文件。但是,这个模块的名称空间是com.101tec,而错误是指向org.101tec。我不知道该怎么办。任何提示都会非常有用。
1条答案
按热度按时间lf3rwulv1#
这两个错误都是在执行
feature:install camel-kafka
通过从安装zkclient jar文件https://github.com/sgroschupf/zkclient.