Storm1.1.0 + kafka0.10.2.1:NoSuchMethodError& ExceptionInInitializerError

时间:2017-06-15 02:59:47

标签: apache-kafka apache-storm opentsdb

我是风暴和卡夫卡的新手。我想运行一个开源项目:github:cestella:streaming_outliers

该项目使用storm0.10.0。但是,我的风暴群集是storm1.0.3,这对storm0.10.0无效。

所以,我必须更改风暴版本和一些相关的软件包。

然后,当我运行此拓扑时,它将导致以下错误。

  

java.lang.NoSuchMethodError:org.apache.kafka.common.network.NetworkSend。(Ljava / lang / String; Ljava / nio / ByteBuffer;)V at kafka.network.RequestOrResponseSend。(RequestOrResponseSend.scala:41) at kafka.network.RequestOrResponseSend。(RequestOrResponseSend.scala:44)at kafka.network.BlockingChannel.send(BlockingChannel.scala:112)at kafka.consumer.SimpleConsumer.liftedTree1 $ 1(SimpleConsumer.scala:98)at kafka.consumer。 SimpleConsumer.kafka $ consumer $ SimpleConsumer $$ sendRequest(SimpleConsumer.scala:83)at kafka.consumer.SimpleConsumer.getOffsetsBefore(SimpleConsumer.scala:149)at kafka.javaapi.consumer.SimpleConsumer.getOffsetsBefore(SimpleConsumer.scala:79)at org.apache.storm.kafka.KafkaUtils.getOffset(KafkaUtils.java:75)位于org.apache.storm.kafka.PartitionManager的org.apache.storm.kafka.KafkaUtils.getOffset(KafkaUtils.java:65)。(PartitionManager) .java:103)org.apache.storm.kafka.ZkCoordinator.refresh(ZkCoordinator.java:98)org.apache.storm.kafka.ZkCoordinator.getMyManagedPartitions(Z) kCoordinator.java:69)org.apache.storm.kafka.KafkaSpout.nextTuple(KafkaSpout.java:129)at org.apache.storm.daemon.executor $ fn__4905 $ fn__4920 $ fn__4951.invoke(executor.clj:644) at org.apache.storm.util $ async_loop $ fn__557.invoke(util.clj:484)at pdjure.lang.AFn.run(AFn.java:22)at java.lang.Thread.run(Thread.java:745) )

  位于kafka.consumer.FetchRequestAndResponseMetrics.newTimer(FetchRequestAndResponseStats.scala:26)的kafka.metrics.KafkaMetricsGroup $ class.newTimer(KafkaMetricsGroup.scala:90)中的java.lang.ExceptionInInitializerError位于kafka.consumer.FetchRequestAndResponseMetrics。(FetchRequestAndResponseStats。 scala:35)at kafka.consumer.FetchRequestAndResponseStats。(FetchRequestAndResponseStats.scala:47)at kafka.consumer.FetchRequestAndResponseStatsRegistry $$ anonfun $ 2.apply(FetchRequestAndResponseStats.scala:60)at kafka.consumer.FetchRequestAndResponseStatsRegistry $$ anonfun $ 2.apply( FetchRequestAndResponseStats.scala:60)在kafka.utils.Pool.getAndMaybePut的kafka.utils.Pool.getAndMaybePut(Pool.scala:70)的kafka.utils.Pool $$ anonfun $ getAndMaybePut $ 1.apply(Pool.scala:52) (Pool.scala:52)位于kafka.consumer.SumpleConsumer的kafka.consumer.FetchRequestAndResponseStatsRegistry $ .getFetchRequestAndResponseStats(FetchRequestAndResponseStats.scala:64)。(SimpleConsumer.scala:44)at kafka.javaapi.consumer.SimpleC onsumer。(SimpleConsumer.scala:34)atg.apache.storm.kafka.DynamicPartitionConnections.register(DynamicPartitionConnections.java:60)org.apache.storm.kafka.PartitionManager。(PartitionManager.java:74)org.apache位于org.apache.storm.kafka.KafkaSpout.nextTuple(KafkaSpout.java)org.apache.storm.kafka.ZkCoordinator.getMyManagedPartitions(ZkCoordinator.java:69)的.storm.kafka.ZkCoordinator.refresh(ZkCoordinator.java:98) :129)atg.apache.storm.daemon.executor $ fn__4905 $ fn__4920 $ fn__4951.invoke(executor.clj:644)at org.apache.storm.util $ async_loop $ fn__557.invoke(util.clj:484)at at java.lang.Thread.run中的clojure.lang.AFn.run(AFn.java:22)(Thread.java:745)引起:java.lang.IllegalStateException:java.lang.ApplicationShutdownHooks.add中正在进行的关闭( ApplicationShutdownHooks.java:66)位于com.yammer.metrics.Metrics的java.lang.Runtime.addShutdownHook(Runtime.java:211)。(Metrics.java:21)... 21更多

  

显示java.lang.NullPointerException           at net.opentsdb.utils.Config.getBoolean(Config.java:354)〜[stormjar.jar:1.6.6]           在net.opentsdb.utils.Config.loadStaticVariables(Config.java:620)〜[stormjar.jar:1.6.6]           在net.opentsdb.utils.Config.setDefaults(Config.java:532)〜[stormjar.jar:1.6.6]           在net.opentsdb.utils.Config。(Config.java:131)〜[stormjar.jar:1.6.6]           在com.caseystella.analytics.timeseries.tsdb.TSDBHandler $ TSDBConfig。(TSDBHandler.java:127)~ [stormjar.jar:1.6.6]           在com.caseystella.analytics.timeseries.tsdb.TSDBHandler $ TSDBConfig。(TSDBHandler.java:124)〜[stormjar.jar:1.6.6]           在com.caseystella.analytics.timeseries.tsdb.TSDBHandler.configure(TSDBHandler.java:144)〜[stormjar.jar:1.6.6]           在com.caseystella.analytics.outlier.OutlierBolt.prepare(OutlierBolt.java:63)〜[stormjar.jar:1.6.6]           在org.apache.storm.daemon.executor $ fn__4973 $ fn__4986.invoke(executor.clj:791)〜[storm-core-1.0.3.jar:1.0.3]           在org.apache.storm.util $ async_loop $ fn__557.invoke(util.clj:482)[storm-core-1.0.3.jar:1.0.3]   显示java.lang.NullPointerException           at net.opentsdb.utils.Config.getBoolean(Config.java:354)〜[stormjar.jar:1.6.6]           在net.opentsdb.utils.Config.loadStaticVariables(Config.java:620)〜[stormjar.jar:1.6.6]           在net.opentsdb.utils.Config.setDefaults(Config.java:532)〜[stormjar.jar:1.6.6]           在net.opentsdb.utils.Config。(Config.java:131)〜[stormjar.jar:1.6.6]           在com.caseystella.analytics.timeseries.tsdb.TSDBHandler $ TSDBConfig。(TSDBHandler.java:127)~ [stormjar.jar:1.6.6]           在com.caseystella.analytics.timeseries.tsdb.TSDBHandler $ TSDBConfig。(TSDBHandler.java:124)〜[stormjar.jar:1.6.6]           在com.caseystella.analytics.timeseries.tsdb.TSDBHandler.configure(TSDBHandler.java:144)〜[stormjar.jar:1.6.6]           在com.caseystella.analytics.outlier.OutlierBolt.prepare(OutlierBolt.java:63)〜[stormjar.jar:1.6.6]           在org.apache.storm.daemon.executor $ fn__4973 $ fn__4986.invoke(executor.clj:791)〜[storm-core-1.0.3.jar:1.0.3]           在org.apache.storm.util $ async_loop $ fn__557.invoke(util.clj:482)[storm-core-1.0.3.jar:1.0.3]

以下是套餐'版本

  

kafka_version:0.10.2.1

kafka-clients版本:0.10.2.1

storm_version:1.1.0

storm-kafka版本:1.1.0

flux_version:1.1.0

tsdb_version:2.3.0

互联网上有一些方法说,附加kafka-clients的依赖可以解决第一个错误。但是,它不起作用。

非常感谢。

2 个答案:

答案 0 :(得分:0)

当您的应用程序包含同一jar的多个版本时(例如kafka 0.10.2.1& 0.10.0.1),不会出现此类方法错误。检查您的项目依赖项并删除旧版本的jar。

答案 1 :(得分:0)

pop.xml中的

kafka和kafka-clients版本应相互匹配。

<dependency>
  <groupId>org.apache.kafka</groupId>
  <artifactId>kafka_2.12</artifactId>
  <version>1.0.0</version>
</dependency>

<dependency>
  <groupId>org.apache.kafka</groupId>
  <artifactId>kafka-clients</artifactId>
  <version>1.0.0</version>
</dependency>