次のmavenコマンドを使用してトポロジを実行中にエラーが発生しました:
mvn exec:java -Dexec.mainClass="com.test.newpackage.TopologyMain" -Dexec.args="resource/words.txt"
次のコマンドを使用しようとすると:
java -cp ./target/wordcount-0.0.1.jar:/usr/local/hadoop/storm/storm-0.8.1.jar:/usr/local/hadoop/storm/lib/*:/usr/local/hadoop/storm/conf/storm.yaml com.test.newpackage.TopologyMain resource/words.txt
エラーも出力もありません。トポロジをストームに送信した後でも、次を使用します。
storm jar StormEclipse.jar com.test.newpackage.TopologyMain /resource/words.txt
このトポロジは ui(localhost:8080) に表示されません。
[INFO] Scanning for projects...
[INFO] Searching repository for plugin with prefix: 'exec'.
[INFO] ------------------------------------------------------------------------
[INFO] Building Unnamed - com.test.newpackage:wordcount:jar:0.0.1
[INFO] task-segment: [exec:java]
[INFO] ------------------------------------------------------------------------
[INFO] Preparing exec:java
[INFO] No goals needed for project - skipping
[INFO] [exec:java {execution: default-cli}]
[WARNING]
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.codehaus.mojo.exec.ExecJavaMojo$1.run(ExecJavaMojo.java:297)
at java.lang.Thread.run(Thread.java:724)
Caused by: java.lang.NoClassDefFoundError: org/apache/thrift7/TBase
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:788)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:447)
at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at backtype.storm.topology.TopologyBuilder.initCommon(TopologyBuilder.java:215)
at backtype.storm.topology.TopologyBuilder.setSpout(TopologyBuilder.java:178)
at backtype.storm.topology.TopologyBuilder.setSpout(TopologyBuilder.java:164)
at com.test.newpackage.TopologyMain.main(TopologyMain.java:12)
... 6 more
Caused by: java.lang.ClassNotFoundException: org.apache.thrift7.TBase
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 21 more
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] An exception occured while executing the Java class. null
org.apache.thrift7.TBase
[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1 second
[INFO] Finished at: Mon Jul 22 18:55:23 IST 2013
[INFO] Final Memory: 5M/15M
[INFO] ------------------------------------------------------------------------