thrift-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tim wee <tim.sh...@gmail.com>
Subject Re: Problem with Java -- Thrift "strict version old client?"
Date Tue, 17 Feb 2009 19:55:43 GMT
VICTORY! =DThanks for your help. that would've taken me a lot more time to
figure out.

On Tue, Feb 17, 2009 at 9:25 AM, Bryan Duxbury <bryan@rapleaf.com> wrote:

> You need to give your TServer TFramedTransporFactory as the input/output
> transport factories. One of the other constructor overloads should do the
> trick for you.
>
> -Bryan
>
>
> On Feb 17, 2009, at 9:15 AM, Tim Wee wrote:
>
>  oh, oops, thanks!
>> Which one is the equivalent on the server side?
>>
>> I see only TNonblockingServerSocket and TServerSocket when I look at the
>> type hierarchy....
>>
>>
>>
>> ________________________________
>> From: Bryan Duxbury <bryan@rapleaf.com>
>> To: thrift-user@incubator.apache.org
>> Sent: Tuesday, February 17, 2009 7:39:43 AM
>> Subject: Re: Problem with Java -- Thrift "strict version old client?"
>>
>> The problem is that you used the framed transport on the client side but
>> not on the server side.
>>
>> On Feb 17, 2009, at 1:39 AM, tim wee wrote:
>>
>>  Hello thrift-users,
>>> Just wondering if anyone has gotten this error before. Both client and
>>> server are in java...
>>>
>>> Feb 17, 2009 1:14:32 AM
>>> org.apache.thrift.server.TThreadPoolServer$WorkerProcess run
>>>
>>>     [java] SEVERE: Thrift error occurred during processing of message.
>>>
>>>     [java] org.apache.thrift.protocol.TProtocolException: Missing version
>>> in readMessageBegin, old client?
>>>
>>>     [java] at
>>> org.apache.thrift.protocol.TBinaryProtocol.readMessageBegin(
>>> TBinaryProtocol.java:189)
>>>
>>>     [java] at bag_banner.gen.Environment$Processor.process(
>>> Environment.java:205)
>>>
>>>     [java] at
>>> org.apache.thrift.server.TThreadPoolServer$WorkerProcess.run(
>>> TThreadPoolServer.java:240)
>>>
>>>     [java] at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(
>>> ThreadPoolExecutor.java:650)
>>>
>>>     [java] at java.util.concurrent.ThreadPoolExecutor$Worker.run(
>>> ThreadPoolExecutor.java:675)
>>>
>>>     [java] at java.lang.Thread.run(Thread.java:613)
>>>
>>> client side code:
>>>
>>> TSocket sock = new TSocket(new Socket(host, envPort));
>>>
>>> TFramedTransport transport = new TFramedTransport(sock);
>>>
>>> TBinaryProtocol protocol = new TBinaryProtocol(transport, true, true);
>>>
>>>
>>>
>>> serverside:
>>>
>>> TServerSocket serverTransport = new TServerSocket(port);
>>>
>>> Environment.Processor processor = new Environment.Processor(env);
>>>
>>> Factory protFactory = new TBinaryProtocol.Factory(true, true);
>>>
>>> TThreadPoolServer server = new TThreadPoolServer(processor,
>>> serverTransport,
>>>
>>> protFactory);
>>>
>>>  System.out.println("starting simulator server");
>>>
>>> server.serve();
>>>
>>>
>>>
>>> I took a look at the source code, and it seems like the booleans being
>>> passed into TBinaryProtocol.Factory (serverside) and TBinaryProtocol
>>> (clientside) just have to match.
>>>
>>>
>>> I tried false with both as well, (to not check versions) it went through,
>>> but then it didn't get to my server-side code, which implemented the
>>> Iface
>>> of the generated class. I put debugging/printout statements inside the
>>> generated class, and it seems like it doesn't return or do anything after
>>> the process method of the Processor, specifically after calling
>>> this. iprot.readMessageBegin();
>>>
>>>
>>> Any help or insight on what I should try next is appreciated. Thanks!
>>>
>>>
>>> Tim
>>>
>>
>>
>>
>


-- 
Timothy Wee
612-889-1185

http://greystark.blogspot.com

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