代码:
conf.setMaxTaskParallelism(1);
LocalCluster cluster = new LocalCluster();
cluster.submitTopology("srslog", conf, builder.createTopology());
Thread.sleep(180000);
cluster.killTopology("storm-mobile1");
cluster.shutdown();
运行报错:
storm java.lang.NoClassDefFoundError: scala/collection/GenTraversableOnce$class
解决办法
The collection API is different between Scala 2.10 and 2.11
Scala 2.10 - kafka_2.10-0.10.2.1
Scala 2.12 - kafka_2.12-0.10.2.1
<dependency>
<groupId>org.scala-lang</groupId>
<artifactId>scala-library</artifactId>
<version>2.10.6</version>
</dependency>
测试ok 从2.11 降低到2.10