Please check your local maven repository firstly if the thrift jar is downloaded. I use this config in the pom.xml, it works well. <dependency> <groupId>org.apache.thrift</groupId> <artifactId>libfb303</artifactId> <version>0.9.1</version> </dependency>
[email protected] ???????? ?????? ?????????? 2014-03-17 11:06 ???????? user ?????? NoClassDefFoundError org/apache/thrift/protocol/TProtocolFactory hi, I'm using thrift 0.9.1 and build a java project with maven. It packages the project well but when I run the project, it throws an exception: Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/thrift/protocol/TProtocolFactory The command line I ran the program is : java -cp target/simple_proxy-1.0-SNAPSHOT.jar com.xx.App and the full stack list is: Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/thrift/protocol/TProtocolFactory Caused by: java.lang.ClassNotFoundException: org.apache.thrift.protocol.TProtocolFactory at java.net.URLClassLoader$1.run(URLClassLoader.java:217) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:205) at java.lang.ClassLoader.loadClass(ClassLoader.java:321) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294) at java.lang.ClassLoader.loadClass(ClassLoader.java:266) Related maven dependency is: <dependency> <groupId>org.apache.thrift</groupId> <artifactId>libthrift</artifactId> <version>0.9.1</version> </dependency> Can anyone help me? Thanks.
