storm-starter with intellij idea,maven project could not find class

谁说我不能喝 提交于 2019-12-04 09:42:52

Strom already has required jar on the server side. So, if look into the pom.xml you find something similar to: https://github.com/apache/storm/blob/master/examples/storm-starter/pom.xml

<dependency>
  <groupId>org.apache.storm</groupId>
  <artifactId>storm-core</artifactId>
  <version>${project.version}</version>
  <!-- keep storm out of the jar-with-dependencies -->
  <scope>provided</scope>
</dependency>

The provided scope is only available on the compilation and test classpath. Because of it your project compiles, but then fails in the runtime with exception : java.lang.NoClassDefFoundError.

Please, comment the scope line in your pom.xml and update maven dependencies to solve this problem. It should looks like:

<dependency>
  <groupId>org.apache.storm</groupId>
  <artifactId>storm-core</artifactId>
  <version>${project.version}</version>
  <!-- keep storm out of the jar-with-dependencies -->
  <!-- <scope>provided</scope> -->
</dependency>
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!