thrift-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "郑华斌" <>
Subject 回复: NoClassDefFoundError org/apache/thrift/protocol/TProtocolFactory
Date Mon, 17 Mar 2014 03:32:06 GMT
Thanks very much.
 I noticed there is a dependency directory under the "target" directory.
 finally I solved it by running like this.
 java -cp target/simple_proxy-1.0-SNAPSHOT.jar:target/dependency/* com.xx.App


 ------------------ 原始邮件 ------------------
  发件人: "Matthew Chambers";<>;
 发送时间: 2014年3月17日(星期一) 中午11:10
 收件人: "user"<>; 
 主题: Re: NoClassDefFoundError org/apache/thrift/protocol/TProtocolFactory


You probably need to add the path to the thrift jar file in your command 
line, unless its being dumped into simple_proxy but I doubt it is.  I 
believe you can build a jar meant for execution which is a lot like a 
war in the way it has all the dependencies embedded into the jar.

On 17/03/14 16:06, 郑华斌 wrote:
> 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:
>      The command line I ran the program is : java -cp target/simple_proxy-1.0-SNAPSHOT.jar
>       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$
>          at Method)
>          at
>          at java.lang.ClassLoader.loadClass(
>          at sun.misc.Launcher$AppClassLoader.loadClass(
>          at java.lang.ClassLoader.loadClass(
>   Related maven dependency is:
>       <dependency>
>        <groupId>org.apache.thrift</groupId>
>        <artifactId>libthrift</artifactId>
>        <version>0.9.1</version>
>      </dependency>
>   Can anyone help me? Thanks.

  • Unnamed multipart/alternative (inline, 8-Bit, 0 bytes)
View raw message