thrift-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Juan Moreno <jwellington.mor...@gmail.com>
Subject Re: Compilation errors on generated Java code Thrift 0.8.0
Date Thu, 20 Sep 2012 03:13:36 GMT
Could it be that the compiler you are using has a different version than
the dependency listed?
On Sep 19, 2012 9:02 PM, "Nipun Bhatia" <nipunbhatia@gmail.com> wrote:

> hey
> I was experimenting with a simple Thrift server and wanted to write
> the client in java.
> I ran the command
> ->thrift -gen java BLT.thrift
> The generated java file Optimization.java shows the following error in
> the Eclipse IDE.
> Code snippet:
>    public static class Client extends org.apache.thrift.TServiceClient
> implements   Iface
> Error:
> The type TServiceClient cannot be the superclass of Client; a
> superclass must be a class
>
> public Client(org.apache.thrift.protocol.TProtocol prot)
>     {
>       super(prot, prot);
>     }
> The constructor Object(TProtocol, TProtocol) is undefined.
> .....
>
>
> I still went ahead and compiled it.
> ->mvn clean install
> Optimization.java:[38,54] no interface expected here
> [ERROR] /thrift/Optimization.java:[39,83] type parameter
> model.thrift.Optimization.Client is not within its bound
> [ERROR] /thrift/Optimization.java:[68,6] cannot find symbol
> symbol  : method
>
> sendBase(java.lang.String,com.model.thrift.Optimization.maximizeRevenue_args)
> location: class model.thrift.Optimization.Client
> [ERROR] /thrift/Optimization.java:[74,6] cannot find symbol
> symbol  : method
>
> receiveBase(model.thrift.Optimization.maximizeRevenue_result,java.lang.String)
> location: class model.thrift.Optimization.Client
> [ERROR] /thrift/Optimization.java:[98,97] cannot find symbol
> symbol  : variable ___protocolFactory
> location: model.thrift.Optimization.AsyncClient
> [ERROR] /thrift/Optimization.java:[98,117] cannot find symbol
> symbol  : variable ___transport
> location: class model.thrift.Optimization.AsyncClient
> [ERROR] /thrift/Optimization.java:[99,10] cannot find symbol
> symbol  : variable ___currentMethod
> location: class model.thrift.Optimization.AsyncClient
> [ERROR] /thrift/Optimization.java:[100,6] cannot find symbol
> symbol  : variable ___manager
> location: class thrift.Optimization.AsyncClient
> [ERROR] /thrift/Optimization.java:[387,23] cannot find symbol
> symbol  : method getScheme()
> location: class org.apache.thrift.protocol.TProtocol
> [ERROR] /thrift/Optimization.java:[391,23] cannot find symbol
> symbol  : method getScheme()
> location: class org.apache.thrift.protocol.TProtocol
> [ERROR] /thrift/Optimization.java:[665,23] cannot find symbol
> symbol  : method getScheme()
> location: class org.apache.thrift.protocol.TProtocol
> [ERROR] /thrift/Optimization.java:[669,23] cannot find symbol
> symbol  : method getScheme()
>
> I have the following dependency in my pom.xml
>
> <dependency>
>     <groupId>org.apache.thrift</groupId>
>      <artifactId>libthrift</artifactId>
>      <version>0.8.0</version>
> </dependency>
>
> -> mvn dependency:tree | grep -i thrift
> [INFO] \- org.apache.thrift:libthrift:jar:0.8.0:compile
>
> -> thrift -version java
> Thrift version 0.8.0
>
> I did find this thread but the recommended solution didnt work for me
> http://stackoverflow.com/questions/2582085/maven-thrift-repository
>
> Any help/insight  would be much appreciated.
>
> Thanks
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message