java.lang.classnotfoundexception:twitter4j.conf.PropertyConfiguration工厂

fcg9iug3  于 2021-06-21  发布在  Storm
关注(0)|答案(0)|浏览(154)

当我在apachestorm集群上启动这个示例源文件时(下面有简单的storm执行命令):

storm jar storm-starter-0.10.0-beta1.jar storm.starter.PrintSampleStream

https://github.com/apache/storm/blob/master/examples/storm-starter/src/jvm/storm/starter/printsamplestream.java
我在storm Environment上发生了此错误(编译或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>

storm Environment上的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时,conf包中不存在类“twitter4j.conf.propertyconfigurationfactory”,我不明白为什么。编译后可以添加吗?
有没有人已经出现过这个执行问题?

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题