javamavenmaven-2thriftthrift-protocol

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


I am not being able to find any jar which contain this kind of package. Can, anyone tell me in which libthrift Link jar i can find this class and package. I couldn't find any jar containing this package. Everytime i execute my java file it throw following expection:

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

Solution

  • Try searching Central when you're looking for a class. fc:"org.apache.thrift.TBase" suggests org.apache.thrift:libthrift:0.9.0.

    For libthrift7, see the instructions on the Storm wiki: use the http://clojars.org/repo repository and depend directly on storm:storm. storm:libthrift7 will be brought in transitively.