thrift-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "郑华斌" <huabin.zh...@qq.com>
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";<mchambers@wetafx.co.nz>;
 发送时间: 2014年3月17日(星期一) 中午11:10
 收件人: "user"<user@thrift.apache.org>; 
 
 主题: 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:
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.

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