在 storm hbase 集成期间需要在类路径上设置什么 jar
what are the jars needed to set on classpath during storm hbase integration
我正在尝试集成 storm 和 hbase,我的程序正在毫无错误或异常地提交给 storm 拓扑,但是当我检查日志时,我得到 java.lang.RuntimeException: java.lang.ClassNotFoundException:org.apache.storm.hbase.bolt.HBaseBolt 并且我已经将 storm-hbase-0.9.3.jar 添加到类路径中,即 storm lib 文件夹在 运行 时间仍然出现异常 -
java.lang.RuntimeException: java.lang.ClassNotFoundException:
org.apache.storm.hbase.bolt.HBaseBolt at
backtype.storm.serialization.DefaultSerializationDelegate.deserialize(DefaultSerializationDelegate.java:58)
~[storm-core-0.9.3.jar:0.9.3] at
backtype.storm.utils.Utils.deserialize(Utils.java:89)
~[storm-core-0.9.3.jar:0.9.3] at
backtype.storm.utils.Utils.getSetComponentObject(Utils.java:228)
~[storm-core-0.9.3.jar:0.9.3] at
backtype.storm.daemon.task$get_task_object.invoke(task.clj:73)
~[storm-core-0.9.3.jar:0.9.3] at
backtype.storm.daemon.task$mk_task_data$fn__3131.invoke(task.clj:180)
~[storm-core-0.9.3.jar:0.9.3] at
backtype.storm.util$assoc_apply_self.invoke(util.clj:850)
~[storm-core-0.9.3.jar:0.9.3] at
backtype.storm.daemon.task$mk_task_data.invoke(task.clj:173)
~[storm-core-0.9.3.jar:0.9.3] at
backtype.storm.daemon.task$mk_task.invoke(task.clj:184)
~[storm-core-0.9.3.jar:0.9.3] at
backtype.storm.daemon.executor$mk_executor$fn__3310.invoke(executor.clj:323)
~[storm-core-0.9.3.jar:0.9.3] at
clojure.core$map$fn__4207.invoke(core.clj:2485)
~[clojure-1.5.1.jar:na] at clojure.lang.LazySeq.sval(LazySeq.java:42)
~[clojure-1.5.1.jar:na] at clojure.lang.LazySeq.seq(LazySeq.java:60)
~[clojure-1.5.1.jar:na] at clojure.lang.RT.seq(RT.java:484)
~[clojure-1.5.1.jar:na] at clojure.core$seq.invoke(core.clj:133)
~[clojure-1.5.1.jar:na] at
clojure.core.protocols$seq_reduce.invoke(protocols.clj:30)
~[clojure-1.5.1.jar:na] at
clojure.core.protocols$fn__6026.invoke(protocols.clj:54)
~[clojure-1.5.1.jar:na] at
clojure.core.protocols$fn__5979$G__5974__5992.invoke(protocols.clj:13)
~[clojure-1.5.1.jar:na] at clojure.core$reduce.invoke(core.clj:6177)
~[clojure-1.5.1.jar:na] at clojure.core$into.invoke(core.clj:6229)
~[clojure-1.5.1.jar:na] at
backtype.storm.daemon.executor$mk_executor.invoke(executor.clj:323)
~[storm-core-0.9.3.jar:0.9.3] at
backtype.storm.daemon.worker$fn__3743$exec_fn__1108__auto____3744$iter__3749__3753$fn__3754.invoke(worker.clj:382)
~[storm-core-0.9.3.jar:0.9.3] at
clojure.lang.LazySeq.sval(LazySeq.java:42) ~[clojure-1.5.1.jar:na] at
clojure.lang.LazySeq.seq(LazySeq.java:60) ~[clojure-1.5.1.jar:na] at
clojure.lang.RT.seq(RT.java:484) ~[clojure-1.5.1.jar:na] at
clojure.core$seq.invoke(core.clj:133) ~[clojure-1.5.1.jar:na] at
clojure.core$dorun.invoke(core.clj:2780) ~[clojure-1.5.1.jar:na] at
clojure.core$doall.invoke(core.clj:2796) ~[clojure-1.5.1.jar:na] at
backtype.storm.daemon.worker$fn__3743$exec_fn__1108__auto____3744.invoke(worker.clj:382)
~[storm-core-0.9.3.jar:0.9.3] at
clojure.lang.AFn.applyToHelper(AFn.java:185) [clojure-1.5.1.jar:na]
at clojure.lang.AFn.applyTo(AFn.java:151) [clojure-1.5.1.jar:na] at
clojure.core$apply.invoke(core.clj:617) ~[clojure-1.5.1.jar:na] at
backtype.storm.daemon.worker$fn__3743$mk_worker__3799.doInvoke(worker.clj:354)
[storm-core-0.9.3.jar:0.9.3] at
clojure.lang.RestFn.invoke(RestFn.java:512) [clojure-1.5.1.jar:na] at
backtype.storm.daemon.worker$_main.invoke(worker.clj:461)
[storm-core-0.9.3.jar:0.9.3] at
clojure.lang.AFn.applyToHelper(AFn.java:172) [clojure-1.5.1.jar:na]
at clojure.lang.AFn.applyTo(AFn.java:151) [clojure-1.5.1.jar:na] at
backtype.storm.daemon.worker.main(Unknown Source)
[storm-core-0.9.3.jar:0.9.3] Caused by:
java.lang.ClassNotFoundException:
org.apache.storm.hbase.bolt.HBaseBolt at
java.net.URLClassLoader.run(URLClassLoader.java:366) ~[na:1.7.0_72]
at java.net.URLClassLoader.run(URLClassLoader.java:355)
~[na:1.7.0_72] at java.security.AccessController.doPrivileged(Native
Method) ~[na:1.7.0_72] at
java.net.URLClassLoader.findClass(URLClassLoader.java:354)
~[na:1.7.0_72] at
java.lang.ClassLoader.loadClass(ClassLoader.java:425) ~[na:1.7.0_72]
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
~[na:1.7.0_72] at
java.lang.ClassLoader.loadClass(ClassLoader.java:358) ~[na:1.7.0_72]
at java.lang.Class.forName0(Native Method) ~[na:1.7.0_72] at
java.lang.Class.forName(Class.java:274) ~[na:1.7.0_72] at
java.io.ObjectInputStream.resolveClass(ObjectInputStream.java:625)
~[na:1.7.0_72] at
java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1612)
~[na:1.7.0_72] at
java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1517)
~[na:1.7.0_72] at
java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1771)
~[na:1.7.0_72] at
java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1350)
~[na:1.7.0_72] at
java.io.ObjectInputStream.readObject(ObjectInputStream.java:370)
~[na:1.7.0_72] at
backtype.storm.serialization.DefaultSerializationDelegate.deserialize(DefaultSerializationDelegate.java:52)
~[storm-core-0.9.3.jar:0.9.3] ... 36 common frames omitted
2015-04-01T18:20:13.559+0530 b.s.util [ERROR] Halting process: ("Error
on initialization") java.lang.RuntimeException: ("Error on
initialization") at
backtype.storm.util$exit_process_BANG_.doInvoke(util.clj:325)
[storm-core-0.9.3.jar:0.9.3] at
clojure.lang.RestFn.invoke(RestFn.java:423) [clojure-1.5.1.jar:na] at
backtype.storm.daemon.worker$fn__3743$mk_worker__3799.doInvoke(worker.clj:354)
[storm-core-0.9.3.jar:0.9.3] at
clojure.lang.RestFn.invoke(RestFn.java:512) [clojure-1.5.1.jar:na] at
backtype.storm.daemon.worker$_main.invoke(worker.clj:461)
[storm-core-0.9.3.jar:0.9.3] at
clojure.lang.AFn.applyToHelper(AFn.java:172) [clojure-1.5.1.jar:na]
at clojure.lang.AFn.applyTo(AFn.java:151) [clojure-1.5.1.jar:na] at
backtype.storm.daemon.worker.main(Unknown Source)
[storm-core-0.9.3.jar:0.9.3]
谁能告诉我如何解决这个问题,我在类路径中缺少任何 jar 吗?
最后使用插件-
在lib文件夹中添加了pom.xml的所有jar
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.10</version>
<executions>
<execution>
<id>copy-dependencies</id>
<phase>package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>/usr/local/storm/lib</outputDirectory>
<overWriteReleases>false</overWriteReleases>
<overWriteSnapshots>false</overWriteSnapshots>
<overWriteIfNewer>true</overWriteIfNewer>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
一切正常。
我正在尝试集成 storm 和 hbase,我的程序正在毫无错误或异常地提交给 storm 拓扑,但是当我检查日志时,我得到 java.lang.RuntimeException: java.lang.ClassNotFoundException:org.apache.storm.hbase.bolt.HBaseBolt 并且我已经将 storm-hbase-0.9.3.jar 添加到类路径中,即 storm lib 文件夹在 运行 时间仍然出现异常 -
java.lang.RuntimeException: java.lang.ClassNotFoundException: org.apache.storm.hbase.bolt.HBaseBolt at backtype.storm.serialization.DefaultSerializationDelegate.deserialize(DefaultSerializationDelegate.java:58) ~[storm-core-0.9.3.jar:0.9.3] at backtype.storm.utils.Utils.deserialize(Utils.java:89) ~[storm-core-0.9.3.jar:0.9.3] at backtype.storm.utils.Utils.getSetComponentObject(Utils.java:228) ~[storm-core-0.9.3.jar:0.9.3] at backtype.storm.daemon.task$get_task_object.invoke(task.clj:73) ~[storm-core-0.9.3.jar:0.9.3] at backtype.storm.daemon.task$mk_task_data$fn__3131.invoke(task.clj:180) ~[storm-core-0.9.3.jar:0.9.3] at backtype.storm.util$assoc_apply_self.invoke(util.clj:850) ~[storm-core-0.9.3.jar:0.9.3] at backtype.storm.daemon.task$mk_task_data.invoke(task.clj:173) ~[storm-core-0.9.3.jar:0.9.3] at backtype.storm.daemon.task$mk_task.invoke(task.clj:184) ~[storm-core-0.9.3.jar:0.9.3] at backtype.storm.daemon.executor$mk_executor$fn__3310.invoke(executor.clj:323) ~[storm-core-0.9.3.jar:0.9.3] at clojure.core$map$fn__4207.invoke(core.clj:2485) ~[clojure-1.5.1.jar:na] at clojure.lang.LazySeq.sval(LazySeq.java:42) ~[clojure-1.5.1.jar:na] at clojure.lang.LazySeq.seq(LazySeq.java:60) ~[clojure-1.5.1.jar:na] at clojure.lang.RT.seq(RT.java:484) ~[clojure-1.5.1.jar:na] at clojure.core$seq.invoke(core.clj:133) ~[clojure-1.5.1.jar:na] at clojure.core.protocols$seq_reduce.invoke(protocols.clj:30) ~[clojure-1.5.1.jar:na] at clojure.core.protocols$fn__6026.invoke(protocols.clj:54) ~[clojure-1.5.1.jar:na] at clojure.core.protocols$fn__5979$G__5974__5992.invoke(protocols.clj:13) ~[clojure-1.5.1.jar:na] at clojure.core$reduce.invoke(core.clj:6177) ~[clojure-1.5.1.jar:na] at clojure.core$into.invoke(core.clj:6229) ~[clojure-1.5.1.jar:na] at backtype.storm.daemon.executor$mk_executor.invoke(executor.clj:323) ~[storm-core-0.9.3.jar:0.9.3] at backtype.storm.daemon.worker$fn__3743$exec_fn__1108__auto____3744$iter__3749__3753$fn__3754.invoke(worker.clj:382) ~[storm-core-0.9.3.jar:0.9.3] at clojure.lang.LazySeq.sval(LazySeq.java:42) ~[clojure-1.5.1.jar:na] at clojure.lang.LazySeq.seq(LazySeq.java:60) ~[clojure-1.5.1.jar:na] at clojure.lang.RT.seq(RT.java:484) ~[clojure-1.5.1.jar:na] at clojure.core$seq.invoke(core.clj:133) ~[clojure-1.5.1.jar:na] at clojure.core$dorun.invoke(core.clj:2780) ~[clojure-1.5.1.jar:na] at clojure.core$doall.invoke(core.clj:2796) ~[clojure-1.5.1.jar:na] at backtype.storm.daemon.worker$fn__3743$exec_fn__1108__auto____3744.invoke(worker.clj:382) ~[storm-core-0.9.3.jar:0.9.3] at clojure.lang.AFn.applyToHelper(AFn.java:185) [clojure-1.5.1.jar:na] at clojure.lang.AFn.applyTo(AFn.java:151) [clojure-1.5.1.jar:na] at clojure.core$apply.invoke(core.clj:617) ~[clojure-1.5.1.jar:na] at backtype.storm.daemon.worker$fn__3743$mk_worker__3799.doInvoke(worker.clj:354) [storm-core-0.9.3.jar:0.9.3] at clojure.lang.RestFn.invoke(RestFn.java:512) [clojure-1.5.1.jar:na] at backtype.storm.daemon.worker$_main.invoke(worker.clj:461) [storm-core-0.9.3.jar:0.9.3] at clojure.lang.AFn.applyToHelper(AFn.java:172) [clojure-1.5.1.jar:na] at clojure.lang.AFn.applyTo(AFn.java:151) [clojure-1.5.1.jar:na] at backtype.storm.daemon.worker.main(Unknown Source) [storm-core-0.9.3.jar:0.9.3] Caused by: java.lang.ClassNotFoundException: org.apache.storm.hbase.bolt.HBaseBolt at java.net.URLClassLoader.run(URLClassLoader.java:366) ~[na:1.7.0_72] at java.net.URLClassLoader.run(URLClassLoader.java:355) ~[na:1.7.0_72] at java.security.AccessController.doPrivileged(Native Method) ~[na:1.7.0_72] at java.net.URLClassLoader.findClass(URLClassLoader.java:354) ~[na:1.7.0_72] at java.lang.ClassLoader.loadClass(ClassLoader.java:425) ~[na:1.7.0_72] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308) ~[na:1.7.0_72] at java.lang.ClassLoader.loadClass(ClassLoader.java:358) ~[na:1.7.0_72] at java.lang.Class.forName0(Native Method) ~[na:1.7.0_72] at java.lang.Class.forName(Class.java:274) ~[na:1.7.0_72] at java.io.ObjectInputStream.resolveClass(ObjectInputStream.java:625) ~[na:1.7.0_72] at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1612) ~[na:1.7.0_72] at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1517) ~[na:1.7.0_72] at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1771) ~[na:1.7.0_72] at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1350) ~[na:1.7.0_72] at java.io.ObjectInputStream.readObject(ObjectInputStream.java:370) ~[na:1.7.0_72] at backtype.storm.serialization.DefaultSerializationDelegate.deserialize(DefaultSerializationDelegate.java:52) ~[storm-core-0.9.3.jar:0.9.3] ... 36 common frames omitted 2015-04-01T18:20:13.559+0530 b.s.util [ERROR] Halting process: ("Error on initialization") java.lang.RuntimeException: ("Error on initialization") at backtype.storm.util$exit_process_BANG_.doInvoke(util.clj:325) [storm-core-0.9.3.jar:0.9.3] at clojure.lang.RestFn.invoke(RestFn.java:423) [clojure-1.5.1.jar:na] at backtype.storm.daemon.worker$fn__3743$mk_worker__3799.doInvoke(worker.clj:354) [storm-core-0.9.3.jar:0.9.3] at clojure.lang.RestFn.invoke(RestFn.java:512) [clojure-1.5.1.jar:na] at backtype.storm.daemon.worker$_main.invoke(worker.clj:461) [storm-core-0.9.3.jar:0.9.3] at clojure.lang.AFn.applyToHelper(AFn.java:172) [clojure-1.5.1.jar:na] at clojure.lang.AFn.applyTo(AFn.java:151) [clojure-1.5.1.jar:na] at backtype.storm.daemon.worker.main(Unknown Source) [storm-core-0.9.3.jar:0.9.3]
谁能告诉我如何解决这个问题,我在类路径中缺少任何 jar 吗?
最后使用插件-
在lib文件夹中添加了pom.xml的所有jar<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.10</version>
<executions>
<execution>
<id>copy-dependencies</id>
<phase>package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>/usr/local/storm/lib</outputDirectory>
<overWriteReleases>false</overWriteReleases>
<overWriteSnapshots>false</overWriteSnapshots>
<overWriteIfNewer>true</overWriteIfNewer>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
一切正常。