运维开发网
广告位招商联系QQ:123077622
 
广告位招商联系QQ:123077622

Storm本地启动拓扑报错:Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/storm/topology/IRichSpout

运维开发网 https://www.qedev.com 2020-03-25 18:19 出处:网络 作者:运维开发网整理
问题描述: Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/storm/topology/IRichSpout at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:264) at com.in

问题描述:

Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/storm/topology/IRichSpout
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:264)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:123)
Caused by: java.lang.ClassNotFoundException: org.apache.storm.topology.IRichSpout
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 3 more

原因:

pom.xml中的依赖配置错误

解决方案:

<dependency>
   <groupId>org.apache.storm</groupId>
   <artifactId>storm-core</artifactId>
   <version>1.2.3</version>
   <scope>provided</scope>
</dependency>

本地运行时将<scope>provided</scope>去掉即可(打包时再加上)

扫码领视频副本.gif

0

精彩评论

暂无评论...
验证码 换一张
取 消