【问题标题】:Storm example error风暴示例错误
【发布时间】:2017-01-26 16:17:03
【问题描述】:

我正在本地模式下运行一个简单的字数统计拓扑。当我使用 Intellij IDE 运行拓扑时,一切正常,我从字符串中获得了单词的计数。但是,当我从 Mac 的终端运行拓扑时我得到错误:

A JNI error has occurred, please check your installation and try again
Exception in thread "main" java.lang.NoClassDefFoundError: backtype/storm/topology/IRichSpout
at java.lang.Class.getDeclaredMethods0(Native Method) 
at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)
at java.lang.Class.privateGetMethodRecursive(Class.java:3048)
at java.lang.Class.getMethod0(Class.java:3018)
at java.lang.Class.getMethod0(Class.java:3018)
at java.lang.Class.getMethod(Class.java:1784)
at sun.launcher.LauncherHelper.validateMainClass(LauncherHelper.java:544)

我在正确的文件中使用了命令 mvn package 和storm jar target/WordCount-1.0-SNAPSHOT.jar com.microsoft.example.WordCountTopology。有什么想法吗?

【问题讨论】:

    标签: xml maven apache-storm topology


    【解决方案1】:

    您需要设置STORM_HOME。找不到需要的jar,应该在$STORM_HOME/lib

    或者,您可以通过将pom.xml 中的storm-core 依赖项指定为<scope>compile</scope> 来构建一个far jar。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-10-15
      • 2014-10-27
      • 1970-01-01
      • 2015-01-22
      • 1970-01-01
      相关资源
      最近更新 更多