The JDK 1.8.0 comes with _131
Apache - storm - 0.9.5
9.2 0.8.1.1 kafka_2.
In the heart of the eclipse program into the jar package (including lib package), submitted to the nimbus, submitted to the following error:
/root @ master ~ # storm jar mykafka. Jar com. Ks. Topology. CounterTopology
Running:/opt/java/jdk1.8.0_131/bin/java -client -Dstorm.options=-Dstorm.home=/opt/apache-storm-0.9.5 -Dstorm.log.dir=/opt/apache-storm-0.9.5/logs -Djava.library.path=/usr/local/lib:/opt/local/lib:/usr/lib -Dstorm.conf.file=-cp/opt/apache-storm-0.9.5/mykafka.jar:/opt/apache-storm-0.9.5/lib/core.incubator-0.1.0.jar:/opt/apache-storm-0.9.5/lib/kryo-2.21.jar:/opt/apache-storm-0.9.5/lib/log4j-over-slf4j-1.6.6.jar:/opt/apache-storm-0.9.5/lib/joda-time-2.0.jar:/opt/apache-storm-0.9.5/lib/objenesis-1.2.jar:/opt/apache-storm-0.9.5/lib/clj-stacktrace-0.2.2.jar:/opt/apache-storm-0.9.5/lib/jgrapht-core-0.9.0.jar:/opt/apache-storm-0.9.5/lib/snakeyaml-1.11.jar:/opt/apache-storm-0.9.5/lib/servlet-api-2.5.jar:/opt/apache-storm-0.9.5/lib/clojure-1.5.1.jar:/opt/apache-storm-0.9.5/lib/asm-4.0.jar:/opt/apache-storm-0.9.5/lib/commons-logging-1.1.3.jar:/opt/apache-storm-0.9.5/lib/ring-core-1.1.5.jar:/opt/apache-storm-0.9.5/lib/tools.cli-0.2.4.jar:/opt/apache-storm-0.9.5/lib/jetty-util-6.1.26.jar:/opt/apache-storm-0.9.5/lib/tools.macro-0.1.0.jar:/opt/apache-storm-0.9.5/lib/commons-codec-1.6.jar:/opt/apache-storm-0.9.5/lib/ring-devel-0.3.11.jar:/opt/apache-storm-0.9.5/lib/clj-time-0.4.1.jar:/opt/apache-storm-0.9.5/lib/json-simple-1.1.jar:/opt/apache-storm-0.9.5/lib/ring-servlet-0.3.11.jar:/opt/apache-storm-0.9.5/lib/logback-core-1.0.13.jar:/opt/apache-storm-0.9.5/lib/jetty-6.1.26.jar:/opt/apache-storm-0.9.5/lib/minlog-1.2.jar:/opt/apache-storm-0.9.5/lib/slf4j-api-1.7.5.jar:/opt/apache-storm-0.9.5/lib/tools.logging-0.2.3.jar:/opt/apache-storm-0.9.5/lib/commons-lang-2.5.jar:/opt/apache-storm-0.9.5/lib/commons-exec-1.1.jar:/opt/apache-storm-0.9.5/lib/compojure-1.1.3.jar:/opt/apache-storm-0.9.5/lib/logback-classic-1.0.13.jar:/opt/apache-storm-0.9.5/lib/math.numeric-tower-0.0.1.jar:/opt/apache-storm-0.9.5/lib/reflectasm-1.07-shaded.jar:/opt/apache-storm-0.9.5/lib/carbonite-1.4.0.jar:/opt/apache-storm-0.9.5/lib/disruptor-2.10.1.jar:/opt/apache-storm-0.9.5/lib/commons-fileupload-1.2.1.jar:/opt/apache-storm-0.9.5/lib/commons-io-2.4.jar:/opt/apache-storm-0.9.5/lib/hiccup-0.3.6.jar:/opt/apache-storm-0.9.5/lib/ring-jetty-adapter-0.3.11.jar:/opt/apache-storm-0.9.5/lib/storm-core-0.9.5.jar:/opt/apache-storm-0.9.5/lib/clout-1.0.1.jar:/opt/apache-storm-0.9.5/lib/jline-2.11.jar:/opt/apache-storm-0.9.5/lib/chill-java-0.3.5.jar:mykafka.jar:/opt/apache-storm-0.9.5/conf:/opt/apache-storm-0.9.5/bin -Dstorm.jar=mykafka.jar com.ks.topology.CounterTopology
The Exception in the thread "main" Java. Lang. NoClassDefFoundError: kafka/API/OffsetRequest
The at storm. Kafka. KafkaConfig. & lt; init> (KafkaConfig. Java: 24)
The at storm. Kafka. SpoutConfig. & lt; init> (SpoutConfig. Java: 15)
At com. Ks. Topology. CounterTopology. Main (31) CounterTopology. Java:
Under Caused by: Java. Lang. ClassNotFoundException: kafka. API. OffsetRequest
The at java.net.URLClassLoader.findClass URLClassLoader. Java: (381)
The at Java. Lang. This. LoadClass (424). This Java:
At sun. Misc. The Launcher $AppClassLoader. LoadClass (335). The Launcher Java:
The at Java. Lang. This. LoadClass (357). This Java:
. 3 more
CodePudding user response:
1 copy the corresponding version kafka dependent jar package to storm the lib[root @ hdmaster libs] # cp kafka_2. 10-0.8.2.1. Jar/opt/apache - storm - 0.9.5/lib/
[root @ hdmaster libs] # cp scala - library - 2.10.4. Jar/opt/apache - storm - 0.9.5/lib/
[root @ hdmaster libs] # cp metrics - core - 2.2.0. Jar/opt/apache - storm - 0.9.5/lib/
[root @ hdmaster libs] # cp zkclient - 0.3. Jar/opt/apache - storm - 0.9.5/lib/
[root @ hdmaster libs] # cp log4j - 1.2.16. Jar/opt/apache - storm - 0.9.5/lib/
[root @ hdmaster libs] # cp slf4j - API - 1.7.6. Jar/opt/apache - storm - 0.9.5/lib/
[root @ hdmaster libs] # cp jopt - simple - 3.2 jar/opt/apache - storm - 0.9.5/lib/