Uploaded image for project: 'Thrift'
  1. Thrift
  2. THRIFT-3922

Cannot find symbol: class TSerializable when compiling generated java code

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Not A Problem
    • Affects Version/s: None
    • Fix Version/s: None
    • Labels:
      None
    • Environment:

      Ubuntu 16.04.1 LTS (GNU/Linux 4.4.0-36-generic x86_64
      Thrift version 1.0.0-dev

      Description

      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.

      + 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
      

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

      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();
      .
      .
      

      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?

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              arfarf89 Chae Lee
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: