1:初次运行Strom程序出现如下所示的错误,贴一下,方便脑补,也希望帮助到看到的小伙伴:

错误如下所示,主要问题是刚开始使用maven获取jar包的时候需要写<scope>provided</scope>,运行的时候需要把这行注释了即可,这是作用域的问题,开始需要在本地下载jar包,但是在虚拟机运行的时候已经存在这些jar包了,所以再写这句话就冲突了:

 java.lang.NoClassDefFoundError: backtype/storm/topology/IRichSpout
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:)
at java.lang.Class.getMethod0(Class.java:)
at java.lang.Class.getMethod(Class.java:)
at sun.launcher.LauncherHelper.getMainMethod(LauncherHelper.java:)
at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:)
Caused by: java.lang.ClassNotFoundException: backtype.storm.topology.IRichSpout
at java.net.URLClassLoader$.run(URLClassLoader.java:)
at java.net.URLClassLoader$.run(URLClassLoader.java:)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:)
at java.lang.ClassLoader.loadClass(ClassLoader.java:)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:)
at java.lang.ClassLoader.loadClass(ClassLoader.java:)
... more
Exception in thread "main"
Process finished with exit code

解决方法如下所示:

贴下pom.xml文件:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.</modelVersion> <groupId>com.bie</groupId>
<artifactId>storm</artifactId>
<version>1.0-SNAPSHOT</version> <!-- storm的依赖关系 -->
<dependencies>
<dependency>
<groupId>org.apache.storm</groupId>
<artifactId>storm-core</artifactId>
<version>0.9.</version>
<!--<scope>provided</scope>-->
</dependency>
</dependencies> <!--如果依赖外部包,就打不进去外部包,所以需要引入下面所示-->
<build>
<plugins>
<plugin>
<!--把其他外部依赖的jar包打成一个大jar包-->
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
<archive>
<manifest>
<mainClass>com.bie.wordcount.WordCountTopologyMain</mainClass>
</manifest>
</archive>
</configuration>
<executions>
<execution>
<id>make-assembly</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
</plugins>
</build> </project>

停更......

Caused by: java.lang.ClassNotFoundException: backtype.storm.topology.IRichSpout的更多相关文章

  1. 【异常】Caused by: java.lang.ClassNotFoundException: org.springframework.dao.DataIntegrityViolationException

    Caused by: java.lang.ClassNotFoundException: org.springframework.dao.DataIntegrityViolationException ...

  2. android 自定义View Caused by: java.lang.ClassNotFoundException: Didn't find class

    在android studio中, 自定义View 时,出现 Caused by: java.lang.ClassNotFoundException: Didn't find class 在查看包名和 ...

  3. Caused by: java.lang.ClassNotFoundException: org.apache.commons.io.FileUtils

    1.错误叙述性说明 警告: Could not create JarEntryRevision for [jar:file:/D:/MyEclipse/apache-tomcat-7.0.53/web ...

  4. Caused by: java.lang.ClassNotFoundException: com/sun/tools/internal/xjc/api/XJC

    Caused by: java.lang.ClassNotFoundException: com/sun/tools/internal/xjc/api/XJC 缺少com/sun/tools/inte ...

  5. Caused by: java.lang.ClassNotFoundException: javassist.ClassPool

    1.错误原因 usage: java org.apache.catalina.startup.Catalina [ -config {pathname} ] [ -nonaming ] { -help ...

  6. Caused by: java.lang.ClassNotFoundException: com.mchange.v2.c3p0.ComboPooledDataSource

    1.错误描写叙述 usage: java org.apache.catalina.startup.Catalina [ -config {pathname} ] [ -nonaming ] { -he ...

  7. 生成HFile文件后倒入数据出现Caused by: java.lang.ClassNotFoundException: org.apache.hadoop.hbase.filter.Filter

    数据导入的时候出现: at java.lang.Class.getDeclaredMethods0(Native Method) at java.lang.Class.privateGetDeclar ...

  8. Selenium 出现: Caused by: java.lang.ClassNotFoundException: org.w3c.dom.ElementTraversal

    webDriver 运行的时候出现: Caused by: java.lang.ClassNotFoundException: org.w3c.dom.ElementTraversal 解决办法: 只 ...

  9. Caused by: java.lang.ClassNotFoundException: org.apache.commons.lang3.StringUtils

    1.错误叙述性说明 2014-7-10 23:12:23 org.apache.catalina.core.StandardContext filterStart 严重: Exception star ...

随机推荐

  1. react-router简介

    Web应用中的路由的作用和原理:保证视图和URL的同步,可以把视图看成资源的一种表现.当用户在页面中进行操作时,应用会在若干个交互状态中切换,比如用户会单击浏览器的前进.后退按钮进行切换等.路由系统的 ...

  2. ios webview调试

    chrome://inspect/#devices if (Build.VERSION.SDK_INT >=Build.VERSION_CODES.KITKAT) { WebView.setWe ...

  3. 关于CactiEZ自定义气象图的配置

    作者:邓聪聪 主要目录: Weathermap主目录:/var/www/html/plugins/weathermap 图片目录(包含背景图标文件):/var/www/html/plugins/wea ...

  4. 设计模式C++学习笔记之四(Multition多例模式)

      多例模式,这个在GOF的模式设计里没有提到,但在实际工作中确实会用到.更详细的内容及说明可以参考原作者博客:cbf4life.cnblogs.com. 4.1.解释 main(),客户 略 说明: ...

  5. ifconfig相关参数及用法说明

    一.ifconfig ifconfig 主要是可以手动启动.观察与修改网络接口的相关参数,可以修改的参数很多,包括 IP 参数以及 MTU 等都可以修改,它的语法如下: [root@linux ~]# ...

  6. System.Data.SqlClient.SqlException: 数据类型 text 和 varchar 在 equal to 运算符中不兼容。

    一.引起的源头 环境:vs2015,sqlserver2008 相关程序包:ef6 定义了一个实体article public class Article { public string Data{g ...

  7. socket 通信 error:88

    调用函数(setsockopt)来设置 recv buffer 和send  buffer时报错: setsockopt error: Socket operation on non-socket(e ...

  8. Qt5全局热键第三方库qxtglobalshortcut5使用

    1.下载第三方库https://github.com/ddqd/qxtglobalshortcut5. 2.把qxtglobalshortcut5文件放在项目目录下,在项目.pro加入一句,inclu ...

  9. T-SQL 数值函数

    MS SQL Server数字函数可以应用于数值数据,并返回数值数据. 下面是带有示例的数值函数列表. ABS() 输出给定值的绝对值. 例 以下查询将输出-22的绝对值:22. Select ABS ...

  10. 51nod--1264 线段相交 (计算几何基础, 二维)

    题目: 1264 线段相交 基准时间限制:1 秒 空间限制:131072 KB 分值: 0 难度:基础题 收藏 关注 给出平面上两条线段的两个端点,判断这两条线段是否相交(有一个公共点或有部分重合认为 ...