1:初次运行Strom程序出现如下所示的错误,贴一下,方便脑补,也希望帮助到看到的小伙伴:
错误如下所示,主要问题是刚开始使用maven获取jar包的时候需要写<scope>provided</scope>,运行的时候需要把这行注释了即可,这是作用域的问题,开始需要在本地下载jar包,但是在虚拟机运行的时候已经存在这些jar包了,所以再写这句话就冲突了:
1 java.lang.NoClassDefFoundError: backtype/storm/topology/IRichSpout 2 at java.lang.Class.getDeclaredMethods0(Native Method) 3 at java.lang.Class.privateGetDeclaredMethods(Class.java:2625) 4 at java.lang.Class.getMethod0(Class.java:2866) 5 at java.lang.Class.getMethod(Class.java:1676) 6 at sun.launcher.LauncherHelper.getMainMethod(LauncherHelper.java:494) 7 at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:486) 8 Caused by: java.lang.ClassNotFoundException: backtype.storm.topology.IRichSpout 9 at java.net.URLClassLoader$1.run(URLClassLoader.java:366) 10 at java.net.URLClassLoader$1.run(URLClassLoader.java:355) 11 at java.security.AccessController.doPrivileged(Native Method) 12 at java.net.URLClassLoader.findClass(URLClassLoader.java:354) 13 at java.lang.ClassLoader.loadClass(ClassLoader.java:425) 14 at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308) 15 at java.lang.ClassLoader.loadClass(ClassLoader.java:358) 16 ... 6 more 17 Exception in thread "main" 18 Process finished with exit code 1
解决方法如下所示:
停更......
原文地址:https://www.cnblogs.com/biehongli/p/8316885.html
时间: 2024-10-28 12:09:09