Chae Lee created THRIFT-3922:
--------------------------------

             Summary: Cannot find symbol: class TSerializable when compiling 
generated java code
                 Key: THRIFT-3922
                 URL: https://issues.apache.org/jira/browse/THRIFT-3922
             Project: Thrift
          Issue Type: Bug
          Components: Java - Compiler, Java - Library
    Affects Versions: 1.0
         Environment: Ubuntu 16.04.1 LTS (GNU/Linux 4.4.0-36-generic x86_64
Thrift version 1.0.0-dev
            Reporter: Chae Lee


Hello,

I am trying out Thrift 1.0 version and compiling the generated Java code is 
giving error that it can't find TSerializable class.

{code}
+ make
rm -rf lang/java/build lang/java/bootake-address-thrift.jar
rm -rf gen-* dist-* docs
thrift -r --gen php:server src/Address/Address.thrift
thrift -r --gen java src/Address/Address.thrift
mkdir -p lang/java/build
javac -cp lang/java/libthrift-0.9.3.jar:lang/java/slf4j.jar -d lang/java/build 
gen-java/com/bootake/addressservice/thrift/*/*.java
gen-java/com/bootake/addressservice/thrift/address/AddressService.java:244: 
error: cannot find symbol
            org.apache.thrift.TSerializable msg;
                             ^
  symbol:   class TSerializable
  location: package org.apache.thrift
1 error
Makefile:17: recipe for target 'java' failed
make: *** [java] Error 1
{code}

Above make works fine with Thrift 0.9.3v. 
The generated code the error is referring to is:

{code:java}
242           public void onError(Exception e) {
243               byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
244               org.apache.thrift.TSerializable msg;                          
              245               searchAddress_result result = new 
searchAddress_result();
.
.
{code}

Checking the logs, it looks like TSerializable was introduced to solve 
THRIFT-2157 issue. It's a generated code that's causing the problem, so I'm a 
bit lost how to fix the case.

Anybody has similar problems?



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to