org.apache.thrift7.TBase vs org.apache.thrift.TBase

时间:2013-07-23 09:26:39

标签: java maven maven-2 thrift thrift-protocol

我无法找到任何包含此类包装的罐子。可以,任何人告诉我在哪个libthrift Link jar我可以找到这个类和包。我找不到任何包含这个包的jar。每次我执行我的java文件时,都会抛出以下内容:

Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/thrift7/TBase
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:791)
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
    at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
    at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
    at backtype.storm.topology.TopologyBuilder.initCommon(TopologyBuilder.java:215)
    at backtype.storm.topology.TopologyBuilder.setSpout(TopologyBuilder.java:178)
    at backtype.storm.topology.TopologyBuilder.setSpout(TopologyBuilder.java:164)
    at com.test.newpackage.TopologyMain.main(TopologyMain.java:12)
Caused by: java.lang.ClassNotFoundException: org.apache.thrift7.TBase
    at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
    ... 16 more

3 个答案:

答案 0 :(得分:3)

在寻找课程时尝试searching Centralfc:"org.apache.thrift.TBase"建议org.apache.thrift:libthrift:0.9.0

对于libthrift7,请参阅instructions on the Storm wiki:使用http://clojars.org/repo存储库并直接依赖storm:stormstorm:libthrift7将被传递给我。

答案 1 :(得分:2)

您是否在maven依赖项中包含org.apache.thrift。如果没有,请包括:

<dependency>
  <groupId>org.apache.thrift</groupId>
  <artifactId>libthrift</artifactId>
  <version>0.9.0</version>
</dependency>

答案 2 :(得分:0)

请包括以下内容:

<!-- https://mvnrepository.com/artifact/storm/libthrift7 -->
<dependency>
    <groupId>storm</groupId>
    <artifactId>libthrift7</artifactId>
    <version>0.7.0-2</version>
</dependency>