在storm-1.0.0和pyleus-0.3.0上运行拓扑时,IRichBolt错误 [英] IRichBolt Error when running topology on storm-1.0.0 and pyleus-0.3.0

查看:85
本文介绍了在storm-1.0.0和pyleus-0.3.0上运行拓扑时,IRichBolt错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用storm-1.0.0, pyleus-0.3.0, centos-6.6运行风暴拓扑"pyleus --verbose local xyz_topology.jar"并获取错误

I'm running storm topology "pyleus --verbose local xyz_topology.jar" using storm-1.0.0, pyleus-0.3.0, centos-6.6 and getting the Error

线程主"中的异常java.lang.NoClassDefFoundError: backtype/storm/topology/IRichBolt

Exception in thread "main" java.lang.NoClassDefFoundError: backtype/storm/topology/IRichBolt

Running: java -client -Ddaemon.name= -Dstorm.options= -Dstorm.home=/usr/local/apache-storm-1.0.0
-Dstorm.log.dir=/usr/local/apache-storm-1.0.0/logs -Djava.library.path=/usr/local/    
lib:/opt/local/lib:/usr/lib -Dstorm.conf.file= -cp /usr/local/apache-storm-1.0.0/lib/asm-5.0.3.jar:
/usr/local/apache-storm-1.0.0/lib/clojure-1.7.0.jar:/usr/local/apache-storm-1.0.0/lib/disruptor-3.3.2.jar:
/usr/local/apache-storm-1.0.0/lib/kryo-3.0.3.jar:
/usr/local/apache-storm-1.0.0/lib/log4j-api-2.1.jar:/usr/local/apache-storm-1.0.0/lib/log4j-core-2.1.jar    
:/usr/local/apache-storm-1.0.0/lib/log4j-over-slf4j-1.6.6.jar:
/usr/local/apache-storm-1.0.0/lib/log4j-slf4j-impl-2.1.jar:/usr/local/apache-storm-1.0.0/lib/minlog-1.3.0.jar:
/usr/local/apache-storm-1.0.0/lib/objenesis-2.1.jar:/usr/local/apache-storm-1.0.0/lib/reflectasm-1.10.1.jar:
/usr/local/apache-storm-1.0.0/lib/servlet-api-2.5.jar:/usr/local/apache-storm-1.0.0/lib/slf4j-api-1.7.7.jar:
/usr/local/apache-storm-1.0.0/lib/storm-core-1.0.0.jar:
/usr/local/apache-storm-1.0.0/lib/storm-rename-hack-1.0.0.jar:xyzTopology.jar:
/usr/local/storm/conf:/usr/local/apache-storm-1.0.0/bin
-Dstorm.jar=xyz_topology.jar com.yelp.pyleus.PyleusTopologyBuilder --local
Error: A JNI error has occurred, please check your installation and try again
Exception in thread "main" java.lang.NoClassDefFoundError: backtype/storm/topology/IRichBolt
        at java.lang.Class.getDeclaredMethods0(Native Method)
        at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)
        at java.lang.Class.privateGetMethodRecursive(Class.java:3048)
        at java.lang.Class.getMethod0(Class.java:3018)
        at java.lang.Class.getMethod(Class.java:1784)
        at sun.launcher.LauncherHelper.validateMainClass(LauncherHelper.java:544)
        at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:526)
Caused by: java.lang.ClassNotFoundException: backtype.storm.topology.IRichBolt
        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)
        ... 7 more
pyleus local: error: [StormError] Storm command failed. Run with --verbose for more info.

使用旧版本的storm-0.10.0 and pyleus-0.3.0时,相同的拓扑效果很好,没有任何错误.

The same topology worked well and without any errors when using the old version of storm-0.10.0 and pyleus-0.3.0.

我查看了storm-0.10.0和storm-1.0.0文档,发现在storm-1.0.0中

I looked at the storm-0.10.0 and storm-1.0.0 docs and found that in storm-1.0.0

(a)软件包的结构已更改,并且

(a) the package structure has been changed and

(b)没有显示IRichBolt类,取而代之的是实现了IRichBolt接口的两个新类-BaseStatefulBoltExecutor和BasicBoltExecutor.

(b) the IRichBolt class is not presented and instead of that there are two new classes - BaseStatefulBoltExecutor and BasicBoltExecutor - which implement IRichBolt interface.

storm-1.0.0的新发行版似乎无法与storm-0.10.0一起使用,就像旧的storm-0.10.0版本一样.

It seems new storm-1.0.0 release can't work with pyleus-0.3.0 as it was with old storm-0.10.0 version.

什么是解决此问题并允许在storm-1.0.0pyleus-0.3.0 上运行拓扑的最佳解决方案?

What would be the best solution to resolve the issue and allow to run the topology on storm-1.0.0 and pyleus-0.3.0 ?

推荐答案

Storm 1.0.0包括有关程序包名称的主要重构.所有软件包backtype/*org/apache/storm取代.因此,您需要使用Storm 1.0.0(包括一些代码更改;即,使用不同的import来适应新的程序包结构)重新编译拓扑.

Storm 1.0.0 includes a major refactoring with regard to package names. All packages backtype/* got replaced by org/apache/storm. Thus, you need to recompile your topology using Storm 1.0.0 (including some code change; ie, using different imports to align to the new package structure).

作为替代方案,您可以在Storm集群中启用向后兼容性(请参见 https ://storm.apache.org/releases/1.0.0/index.html )

As an alternative, you can enable backward compatibility in your Storm cluster (see https://storm.apache.org/releases/1.0.0/index.html)

NOTE

在最新版本中,类包已从"backtype.storm"更改为"org.apache.storm",因此使用较早版本编译的拓扑代码将无法在Storm 1.0.0上运行.通过以下配置可获得向后兼容性

In the latest version, the class packages have been changed from "backtype.storm" to "org.apache.storm" so the topology code compiled with older version won't run on the Storm 1.0.0 just like that. Backward compatibility is available through following configuration

client.jartransformer.class:"org.apache.storm.hack.StormShadeTransformer"

client.jartransformer.class: "org.apache.storm.hack.StormShadeTransformer"

如果要运行使用旧版本的Storm编译的代码,则需要在Storm安装中添加以上配置.该配置应添加到用于提交拓扑的计算机中.

You need to add the above config in storm installation if you want to run the code compiled with older versions of storm. The config should be added in the machine you use to submit your topologies.

请参阅 https://issues.apache.org/jira/browse/STORM- 1202 以获取更多详细信息.

Refer to https://issues.apache.org/jira/browse/STORM-1202 for more details.

这篇关于在storm-1.0.0和pyleus-0.3.0上运行拓扑时,IRichBolt错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆