Unable to run a storm-starter topology from the Storm tutorial

假装没事ソ 提交于 2019-12-04 06:48:58

To be little bit more precise with regard to Nick's answer.

In storm-starter/pom.xml the dependency storm-core is specified with scope "provided":

<dependency>
  <groupId>org.apache.storm</groupId>
  <artifactId>storm-core</artifactId>
  <version>${project.version}</version>
  <!--
    Use "provided" scope to keep storm out of the jar-with-dependencies
    For IntelliJ dev, intellij will load properly.
  -->
  <scope>${provided.scope}</scope>
</dependency>

If you run locally using LocalCluster you need to include storm-core as dependency with default scope "compile", ie, just remove the scope tag, and run mvn -DskipTests package in storm-starter again.

Nick Pavlakis

NoClassDefFoundError regarding Storm, usually refers to errors coming from the <scope> tag in your pom.xml.

If you are trying to run the project on a cluster of machines where you have installed Storm, the <scope> should be "provided" (<scope>provide</scope>), else if you are trying to execute the topology locally, the scope must be set to "compile".

Hope this helps.

the first time I tried to run storm-starter, I got blocked by the missing pom or some dependencies.

I read the document again. Then I found I should install the storm first from the root directory of project not the storm-starter directory.

scope provided should be fine. IDE will try to find it from local repository

I too faced the same issue (Initially NoClassDefFoundError later multiple defaults.yaml)

For me following config change in intellij solved the problem.

Run ---> Edit configurations ---> Tick - Include dependencies with "provided" scope.

So basically when you are running in cluster mode, storm-core's scope should be "provided" in pom.xml. And above configuration will ensure that dependencies will be provided from cluster at run-time.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!