【发布时间】:2014-04-20 06:04:55
【问题描述】:
我正在尝试用Thrift 编写RPC,客户端似乎与服务器通信正常,服务器创建一个列表以返回给客户端(正确格式)。但是当我收到此错误时,客户端不知何故无法识别数据包:
org.apache.thrift.TApplicationException: getEntityByIP failed: unknown result
这是我的 thrift 文件的样子:
struct EntityLookupMessage{
1: list<i32> entityIDs;
}
service EntityJoinService {
list<i32> getEntityByIP(1:string IPval,2:i32 date);
}
而ServerImpl是如下方法:
public List<Integer> getEntityByIP(String IPval, int date) throws TException {
try{
System.out.println("Checking..."+IPval);
List<Integer> response=EntityJoinStandalone.getEntityByIP(entityLookup,IPval, date);
System.out.println(response);
return response;
}finally{
// TODO Auto-generated method stub
return null
}
这样被客户端调用:
List<Integer> entity = client.getEntityByIP(IPval, date);
任何想法为什么会这样?
【问题讨论】:
标签: java rpc thrift thrift-protocol