thrift-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Aleksandr Krasnoperov <akrasnope...@65gb.net>
Subject Apache thrift and android. TTransportException.
Date Wed, 18 Sep 2013 10:20:12 GMT
Hi.

The problem with apache thrift work in android.

I am using apache thrift. There is a php server. There is a client for java
( Simple java project). Everything is working.

When I create a client on Android, the connection to the server is
successful. The functions are processed on the server, but in the
application I get the error :

TTransportException: No more data available.

Transport - http. Protocol - binary.

Code to create a client (and the same in a simple java project and android
project):

TTransport transport = new THttpClient
("http://test.../PhpServer.php");TProtocol protocol = new
TBinaryProtocol (transport);TestService.Client client = new
TestService.Client (protocol);
transport.open ();try {
    client.EchoI32 (4);} Catch (SysException e) {
    e.printStackTrace ();} Catch (TException e) {
    e.printStackTrace ();}

LogCat:

09-09 14:43:07.107: W/System.err(31729):
org.apache.thrift.transport.TTransportException: No more data
available.09-09 14:43:07.107: W/System.err(31729):  at
org.apache.thrift.transport.THttpClient.read(THttpClient.java:190)09-09
14:43:07.107: W/System.err(31729):  at
org.apache.thrift.transport.TTransport.readAll(TTransport.java:84)09-09
14:43:07.107: W/System.err(31729):  at
org.apache.thrift.protocol.TBinaryProtocol.readAll(TBinaryProtocol.java:359)09-09
14:43:07.107: W/System.err(31729):  at
org.apache.thrift.protocol.TBinaryProtocol.readI32(TBinaryProtocol.java:278)09-09
14:43:07.107: W/System.err(31729):  at
org.apache.thrift.protocol.TBinaryProtocol.readMessageBegin(TBinaryProtocol.java:185)09-09
14:43:07.107: W/System.err(31729):  at
org.apache.thrift.TServiceClient.receiveBase(TServiceClient.java:69)09-09
14:43:07.107: W/System.err(31729):  at
com.test.protocol.TestService$Client.recv_EchoI32(TestService.java:912)

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