Hi all,
I write two thrift server A and B, A is C++ and B is JAVA and I use
TFramedTransport and TCompactProtocol in both server and client, the java
server B will proxy some C++ server A interface, If call the java server
directly ,the error message not occured.But when java client call the B and in
B will create a another client to call server A, the error message will occur
when B return the data
2014-01-27 14:22:11,567 ERROR
org.apache.thrift.server.AbstractNonblockingServer$FrameBuffer.read(AbstractNonblockingServer.java:348)
- Read an invalid frame size of 0. Are you using TFramedTransport on the
client side?
The method executeCmd is the interface of B, when the "return result" is
execute , the error message will occur.
@Override
public CmdResult executeCmd(String cmd, List<String> params,
Map<String,String> envs, String execuser) throws InvokeException {
CmdResult result = new CmdResult();
if(StringUtils.isEmpty(cmd)){
throw new InvokeException(0, "Command is null.");
}
if(params == null){
params = new ArrayList<String>();
}
try{
ExecproxyClient client = (ExecproxyClient)ctx.getBean("execproxyClient");
TCmdRequest cmdReq = new TCmdRequest();
cmdReq.setAppName(cmd);
cmdReq.setArguments(params);
cmdReq.setEnvs(envs);
cmdReq.setExecUser(execuser);
TCmdResponse cmdRes = client.execute(cmdReq);
result.setExitCode(cmdRes.getExitCode());
result.setStderr(cmdRes.getStdError());
result.setStdout(cmdRes.getStdOutput());
}catch(Exception e){
InvokeException ie = new InvokeException();
ie.setExpCause("Execproxy : " + e.getMessage());
throw ie;
}
return result;
}
[email protected]