2

我找不到任何包含这种包的 jar。可以,谁能告诉我我可以在哪个 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
4

3 回答 3

3

在寻找课程时尝试搜索 Central 。fc:"org.apache.thrift.TBase"建议org.apache.thrift:libthrift:0.9.0

对于libthrift7,请参阅Storm wiki 上的说明:使用http://clojars.org/repo存储库并直接依赖storm:storm. storm:libthrift7将被传递。

于 2013-07-23T11:43:07.770 回答
2

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

<dependency>
  <groupId>org.apache.thrift</groupId>
  <artifactId>libthrift</artifactId>
  <version>0.9.0</version>
</dependency>
于 2013-07-23T09:38:35.947 回答
0

请包括以下内容:

<!-- https://mvnrepository.com/artifact/storm/libthrift7 -->
<dependency>
    <groupId>storm</groupId>
    <artifactId>libthrift7</artifactId>
    <version>0.7.0-2</version>
</dependency>
于 2017-07-11T11:30:21.613 回答