当我在Apache STORM集群上启动此示例源文件时(下面带有简单的风暴执行命令):
storm jar storm-starter-0.10.0-beta1.jar storm.starter.PrintSampleStream
我在风暴环境中发生此错误(在编译或maven包过程中没有问题):
5503 [Thread-18-twitter] ERROR backtype.storm.util - Async loop died!
java.lang.AssertionError: java.lang.ClassNotFoundException: twitter4j.conf.PropertyConfigurationFactory
at twitter4j.conf.ConfigurationContext.<clinit>(ConfigurationContext.java:43) ~[storm-starter-0.10.0-beta1.jar:0.10.0-beta1]
at twitter4j.Logger.<clinit>(Logger.java:41) ~[storm-starter-0.10.0-beta1.jar:0.10.0-beta1]
at twitter4j.TwitterStreamImpl.<clinit>(TwitterStreamImpl.java:40) ~[storm-starter-0.10.0-beta1.jar:0.10.0-beta1]
at twitter4j.TwitterStreamFactory.<clinit>(TwitterStreamFactory.java:40) ~[storm-starter-0.10.0-beta1.jar:0.10.0-beta1]
at storm.starter.spout.TwitterSampleSpout.open(TwitterSampleSpout.java:88) ~[storm-starter-0.10.0-beta1.jar:0.10.0-beta1]
at backtype.storm.daemon.executor$fn__4127$fn__4142.invoke(executor.clj:519) ~[storm-core-0.9.1.2.1.7.0-784.jar:0.9.1.2.1.7.0-784]
at backtype.storm.util$async_loop$fn__442.invoke(util.clj:434) ~[storm-core-0.9.1.2.1.7.0-784.jar:0.9.1.2.1.7.0-784]
at clojure.lang.AFn.run(AFn.java:24) [clojure-1.4.0.jar:na]
at java.lang.Thread.run(Thread.java:744) [na:1.7.0_45]
Caused by: java.lang.ClassNotFoundException: twitter4j.conf.PropertyConfigurationFactory
at java.net.URLClassLoader$1.run(URLClassLoader.java:366) ~[na:1.7.0_45]
at java.net.URLClassLoader$1.run(URLClassLoader.java:355) ~[na:1.7.0_45]
at java.security.AccessController.doPrivileged(Native Method) ~[na:1.7.0_45]
at java.net.URLClassLoader.findClass(URLClassLoader.java:354) ~[na:1.7.0_45]
at java.lang.ClassLoader.loadClass(ClassLoader.java:425) ~[na:1.7.0_45]
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308) ~[na:1.7.0_45]
at java.lang.ClassLoader.loadClass(ClassLoader.java:358) ~[na:1.7.0_45]
at java.lang.Class.forName0(Native Method) ~[na:1.7.0_45]
at java.lang.Class.forName(Class.java:190) ~[na:1.7.0_45]
at twitter4j.conf.ConfigurationContext.<clinit>(ConfigurationContext.java:41) ~[storm-starter-0.10.0-beta1.jar:0.10.0-beta1]
... 8 common frames omitted
5503 [Thread-18-twitter] ERROR backtype.storm.daemon.executor -
java.lang.AssertionError: java.lang.ClassNotFoundException: twitter4j.conf.PropertyConfigurationFactory
at twitter4j.conf.ConfigurationContext.<clinit>(ConfigurationContext.java:43) ~[storm-starter-0.10.0-beta1.jar:0.10.0-beta1]
at twitter4j.Logger.<clinit>(Logger.java:41) ~[storm-starter-0.10.0-beta1.jar:0.10.0-beta1]
at twitter4j.TwitterStreamImpl.<clinit>(TwitterStreamImpl.java:40) ~[storm-starter-0.10.0-beta1.jar:0.10.0-beta1]
at twitter4j.TwitterStreamFactory.<clinit>(TwitterStreamFactory.java:40) ~[storm-starter-0.10.0-beta1.jar:0.10.0-beta1]
at storm.starter.spout.TwitterSampleSpout.open(TwitterSampleSpout.java:88) ~[storm-starter-0.10.0-beta1.jar:0.10.0-beta1]
at backtype.storm.daemon.executor$fn__4127$fn__4142.invoke(executor.clj:519) ~[storm-core-0.9.1.2.1.7.0-784.jar:0.9.1.2.1.7.0-784]
at backtype.storm.util$async_loop$fn__442.invoke(util.clj:434) ~[storm-core-0.9.1.2.1.7.0-784.jar:0.9.1.2.1.7.0-784]
at clojure.lang.AFn.run(AFn.java:24) [clojure-1.4.0.jar:na]
at java.lang.Thread.run(Thread.java:744) [na:1.7.0_45]
Caused by: java.lang.ClassNotFoundException: twitter4j.conf.PropertyConfigurationFactory
at java.net.URLClassLoader$1.run(URLClassLoader.java:366) ~[na:1.7.0_45]
at java.net.URLClassLoader$1.run(URLClassLoader.java:355) ~[na:1.7.0_45]
at java.security.AccessController.doPrivileged(Native Method) ~[na:1.7.0_45]
at java.net.URLClassLoader.findClass(URLClassLoader.java:354) ~[na:1.7.0_45]
at java.lang.ClassLoader.loadClass(ClassLoader.java:425) ~[na:1.7.0_45]
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308) ~[na:1.7.0_45]
at java.lang.ClassLoader.loadClass(ClassLoader.java:358) ~[na:1.7.0_45]
at java.lang.Class.forName0(Native Method) ~[na:1.7.0_45]
at java.lang.Class.forName(Class.java:190) ~[na:1.7.0_45]
at twitter4j.conf.ConfigurationContext.<clinit>(ConfigurationContext.java:41) ~[storm-starter-0.10.0-beta1.jar:0.10.0-beta1]
... 8 common frames omitted
当我在本地IDE(IntelliJIDEA)上运行相同的代码时,没有崩溃。
在我的pom.xml中,我已经拥有了Twitter4j依赖项:
<dependency>
<groupId>org.twitter4j</groupId>
<artifactId>twitter4j-stream</artifactId>
<version>4.0.4</version>
</dependency>
风暴环境下的JDK版本:
OpenJDK Runtime Environment (rhel-2.6.1.3.el6_6-x86_64 u85-b01)
OpenJDK 64-Bit Server VM (build 24.85-b03, mixed mode)
当我提取jar时,类&#34; twitter4j.conf.PropertyConfigurationFactory&#34; conf包中没有,我不明白为什么。我可以在编译后添加它吗?
有没有人发现过这个执行问题?