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. NandFlash和iNand【转】

    转自:https://www.cnblogs.com/PengfeiSong/p/6380447.html nand 1.nand的单元组织:block与page(大页Nand与小页Nand)(1)N ...

  2. MySQL数据库的锁详解【转】

    当然在我们的数据库中也有锁用来控制资源的并发访问,这也是数据库和文件系统的区别之一. 为什么要懂数据库锁? 通常来说对于一般的开发人员,在使用数据库的时候一般懂点 DQL(select),DML(in ...

  3. python 中@ 的用法【转】

    这只是我的个人理解: 在Python的函数中偶尔会看到函数定义的上一行有@functionName的修饰,当解释器读到@的这样的修饰符之后,会先解析@后的内容,直接就把@下一行的函数或者类作为@后边的 ...

  4. boost 实现http断点续传

    // testc.cpp : Defines the entry point for the console application. // #include "stdafx.h" ...

  5. 题解-APIO2010 特别行动队

    题目 洛谷 & bzoj 简要题意:给定一个长为\(n\)的序列\(\{s_i\}\)与常数\(a,b,c\),序列的一个连续子段\(s_i\)到\(s_j\)的贡献为\(at^2+bt+c\ ...

  6. ASP.NET WEBAPI 使用Swagger生成API文档

    一.安装 新建一个没有身份验证的mvc项目 - SwaggerMvc5Demo,然后添加一个名为Remote(自定义)且包含基础读写(不想手写)的ApiController   开源地址:https: ...

  7. linux 查看nginx如何启动

    执行命令: ps -A | grep nginx如果返回结果的话,说明有nginx在运行,服务已经启动

  8. python学习第7天

    编码的进阶 文件操作 深浅copy

  9. Linux命令之control快捷键组合

    ***********************Linux系统中的一些control快捷键组合汇总如下************************ ctrl+a:光标移到行首. ctrl+b:光标左 ...

  10. mysql连表分组报错---- sql_mode=only_full_group_by问题解决

    #### sql语句报错问题 #1055 - Expression #3 of SELECT list is not in GROUP BY clause and contains nonaggreg ...