You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@thrift.apache.org by Matt Chambers <mv...@me.com> on 2012/10/21 12:10:48 UTC
0.9.0 java + python strangeness
Greetings,
Figured I'd give 0.9.0 a try, getting an exception on the java server, using a python client. This all runs fine on 0.8.0. The server does actually get the data. It puts it into a LinkedBlockingQueue, and then returns. Thats all that happens, so I'm not sure where this is coming from.
java.lang.AbstractMethodError: org.apache.thrift.ProcessFunction.isOneway()Z
at org.apache.thrift.ProcessFunction.process(ProcessFunction.java:51)
at org.apache.thrift.TBaseProcessor.process(TBaseProcessor.java:39)
at org.apache.thrift.server.AbstractNonblockingServer$FrameBuffer.invoke(AbstractNonblockingServer.java:478)
at org.apache.thrift.server.Invocation.run(Invocation.java:18)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:722)
On the client side I'm seeing this.
Traceback (most recent call last):
File "./rndaemon.py", line 8, in <module>
import plow.rndaemon.server as server
File "../../client/python/plow/rndaemon/server.py", line 4, in <module>
import core
File "../../client/python/plow/rndaemon/core.py", line 192, in <module>
ProcessMgr = ProcessManager()
File "../../client/python/plow/rndaemon/core.py", line 74, in __init__
self.sendPing(True)
File "../../client/python/plow/rndaemon/core.py", line 95, in sendPing
Profiler.sendPing(tasks, isReboot)
File "../../client/python/plow/rndaemon/profile/base.py", line 52, in sendPing
service.sendPing(ping)
File "../../client/python/plow/rndaemon/rpc/RndServiceApi.py", line 49, in sendPing
self.recv_sendPing()
File "../../client/python/plow/rndaemon/rpc/RndServiceApi.py", line 60, in recv_sendPing
(fname, mtype, rseqid) = self._iprot.readMessageBegin()
File "/Library/Python/2.7/site-packages/thrift/protocol/TBinaryProtocol.py", line 126, in readMessageBegin
sz = self.readI32()
File "/Library/Python/2.7/site-packages/thrift/protocol/TBinaryProtocol.py", line 203, in readI32
buff = self.trans.readAll(4)
File "/Library/Python/2.7/site-packages/thrift/transport/TTransport.py", line 58, in readAll
chunk = self.read(sz-have)
File "/Library/Python/2.7/site-packages/thrift/transport/TTransport.py", line 272, in read
self.readFrame()
File "/Library/Python/2.7/site-packages/thrift/transport/TTransport.py", line 276, in readFrame
buff = self.__trans.readAll(4)
File "/Library/Python/2.7/site-packages/thrift/transport/TTransport.py", line 58, in readAll
chunk = self.read(sz-have)
File "/Library/Python/2.7/site-packages/thrift/transport/TSocket.py", line 108, in read
raise TTransportException(type=TTransportException.END_OF_FILE, message='TSocket read 0 bytes')
thrift.transport.TTransport.TTransportException: TSocket read 0 bytes
Parts of my thrift file.
struct Hardware {
1:i16 physicalCpus,
2:i16 logicalCpus
3:i32 totalRamMb
4:i32 freeRamMb,
5:i32 totalSwapMb,
6:i32 freeSwapMb,
7:string cpuModel,
8:string platform
}
struct Ping {
1:string hostname,
2:string ipAddr,
3:bool isReboot,
4:i64 bootTime,
5:Hardware hw,
6:list<RunningTask> tasks;
}
service RndServiceApi {
void sendPing(1:Ping ping) throws (1:RndException e),
}
Java server code:
transport = new TNonblockingServerSocket(port);
server = new TThreadedSelectorServer(
new TThreadedSelectorServer.Args(transport)
.processor(processor)
.workerThreads(8)
.selectorThreads(4)
.protocolFactory(new TBinaryProtocol.Factory(true, true))
.transportFactory(new TFramedTransport.Factory()));
Python client code:
host, port = conf.PLOW_HOSTS[0].split(":")
socket = TSocket.TSocket(host, int(port))
transport = TTransport.TFramedTransport(socket)
protocol = TBinaryProtocol.TBinaryProtocol(transport)
service = RndServiceApi.Client(protocol)
transport.open()
Re: 0.9.0 java + python strangeness
Posted by Matt Chambers <mv...@me.com>.
Thanks. I did do that a bunch of times. I actually had to delete maven's 'target' directory and rebuilt, that got going.
On Oct 22, 2012, at 3:04 AM, Andras Szerdahelyi <an...@ignitionone.com> wrote:
> re-compile your java server with 0.9.0. This is a new abstract method on the java library that should be present on the generated service code
> https://issues.apache.org/jira/browse/THRIFT-1447
>
> regards,
> Andras
>
> On 21 Oct 2012, at 12:10, Matt Chambers <mv...@me.com> wrote:
>
>> Greetings,
>>
>> Figured I'd give 0.9.0 a try, getting an exception on the java server, using a python client. This all runs fine on 0.8.0. The server does actually get the data. It puts it into a LinkedBlockingQueue, and then returns. Thats all that happens, so I'm not sure where this is coming from.
>>
>> java.lang.AbstractMethodError: org.apache.thrift.ProcessFunction.isOneway()Z
>> at org.apache.thrift.ProcessFunction.process(ProcessFunction.java:51)
>> at org.apache.thrift.TBaseProcessor.process(TBaseProcessor.java:39)
>> at org.apache.thrift.server.AbstractNonblockingServer$FrameBuffer.invoke(AbstractNonblockingServer.java:478)
>> at org.apache.thrift.server.Invocation.run(Invocation.java:18)
>> at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
>> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
>> at java.lang.Thread.run(Thread.java:722)
>>
>> On the client side I'm seeing this.
>>
>> Traceback (most recent call last):
>> File "./rndaemon.py", line 8, in <module>
>> import plow.rndaemon.server as server
>> File "../../client/python/plow/rndaemon/server.py", line 4, in <module>
>> import core
>> File "../../client/python/plow/rndaemon/core.py", line 192, in <module>
>> ProcessMgr = ProcessManager()
>> File "../../client/python/plow/rndaemon/core.py", line 74, in __init__
>> self.sendPing(True)
>> File "../../client/python/plow/rndaemon/core.py", line 95, in sendPing
>> Profiler.sendPing(tasks, isReboot)
>> File "../../client/python/plow/rndaemon/profile/base.py", line 52, in sendPing
>> service.sendPing(ping)
>> File "../../client/python/plow/rndaemon/rpc/RndServiceApi.py", line 49, in sendPing
>> self.recv_sendPing()
>> File "../../client/python/plow/rndaemon/rpc/RndServiceApi.py", line 60, in recv_sendPing
>> (fname, mtype, rseqid) = self._iprot.readMessageBegin()
>> File "/Library/Python/2.7/site-packages/thrift/protocol/TBinaryProtocol.py", line 126, in readMessageBegin
>> sz = self.readI32()
>> File "/Library/Python/2.7/site-packages/thrift/protocol/TBinaryProtocol.py", line 203, in readI32
>> buff = self.trans.readAll(4)
>> File "/Library/Python/2.7/site-packages/thrift/transport/TTransport.py", line 58, in readAll
>> chunk = self.read(sz-have)
>> File "/Library/Python/2.7/site-packages/thrift/transport/TTransport.py", line 272, in read
>> self.readFrame()
>> File "/Library/Python/2.7/site-packages/thrift/transport/TTransport.py", line 276, in readFrame
>> buff = self.__trans.readAll(4)
>> File "/Library/Python/2.7/site-packages/thrift/transport/TTransport.py", line 58, in readAll
>> chunk = self.read(sz-have)
>> File "/Library/Python/2.7/site-packages/thrift/transport/TSocket.py", line 108, in read
>> raise TTransportException(type=TTransportException.END_OF_FILE, message='TSocket read 0 bytes')
>> thrift.transport.TTransport.TTransportException: TSocket read 0 bytes
>>
>> Parts of my thrift file.
>>
>> struct Hardware {
>> 1:i16 physicalCpus,
>> 2:i16 logicalCpus
>> 3:i32 totalRamMb
>> 4:i32 freeRamMb,
>> 5:i32 totalSwapMb,
>> 6:i32 freeSwapMb,
>> 7:string cpuModel,
>> 8:string platform
>> }
>>
>> struct Ping {
>> 1:string hostname,
>> 2:string ipAddr,
>> 3:bool isReboot,
>> 4:i64 bootTime,
>> 5:Hardware hw,
>> 6:list<RunningTask> tasks;
>> }
>>
>> service RndServiceApi {
>> void sendPing(1:Ping ping) throws (1:RndException e),
>> }
>>
>> Java server code:
>>
>> transport = new TNonblockingServerSocket(port);
>> server = new TThreadedSelectorServer(
>> new TThreadedSelectorServer.Args(transport)
>> .processor(processor)
>> .workerThreads(8)
>> .selectorThreads(4)
>> .protocolFactory(new TBinaryProtocol.Factory(true, true))
>> .transportFactory(new TFramedTransport.Factory()));
>>
>> Python client code:
>>
>> host, port = conf.PLOW_HOSTS[0].split(":")
>> socket = TSocket.TSocket(host, int(port))
>> transport = TTransport.TFramedTransport(socket)
>> protocol = TBinaryProtocol.TBinaryProtocol(transport)
>> service = RndServiceApi.Client(protocol)
>> transport.open()
>>
>>
>>
>
Re: 0.9.0 java + python strangeness
Posted by Andras Szerdahelyi <an...@ignitionone.com>.
re-compile your java server with 0.9.0. This is a new abstract method on the java library that should be present on the generated service code
https://issues.apache.org/jira/browse/THRIFT-1447
regards,
Andras
On 21 Oct 2012, at 12:10, Matt Chambers <mv...@me.com> wrote:
> Greetings,
>
> Figured I'd give 0.9.0 a try, getting an exception on the java server, using a python client. This all runs fine on 0.8.0. The server does actually get the data. It puts it into a LinkedBlockingQueue, and then returns. Thats all that happens, so I'm not sure where this is coming from.
>
> java.lang.AbstractMethodError: org.apache.thrift.ProcessFunction.isOneway()Z
> at org.apache.thrift.ProcessFunction.process(ProcessFunction.java:51)
> at org.apache.thrift.TBaseProcessor.process(TBaseProcessor.java:39)
> at org.apache.thrift.server.AbstractNonblockingServer$FrameBuffer.invoke(AbstractNonblockingServer.java:478)
> at org.apache.thrift.server.Invocation.run(Invocation.java:18)
> at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
> at java.lang.Thread.run(Thread.java:722)
>
> On the client side I'm seeing this.
>
> Traceback (most recent call last):
> File "./rndaemon.py", line 8, in <module>
> import plow.rndaemon.server as server
> File "../../client/python/plow/rndaemon/server.py", line 4, in <module>
> import core
> File "../../client/python/plow/rndaemon/core.py", line 192, in <module>
> ProcessMgr = ProcessManager()
> File "../../client/python/plow/rndaemon/core.py", line 74, in __init__
> self.sendPing(True)
> File "../../client/python/plow/rndaemon/core.py", line 95, in sendPing
> Profiler.sendPing(tasks, isReboot)
> File "../../client/python/plow/rndaemon/profile/base.py", line 52, in sendPing
> service.sendPing(ping)
> File "../../client/python/plow/rndaemon/rpc/RndServiceApi.py", line 49, in sendPing
> self.recv_sendPing()
> File "../../client/python/plow/rndaemon/rpc/RndServiceApi.py", line 60, in recv_sendPing
> (fname, mtype, rseqid) = self._iprot.readMessageBegin()
> File "/Library/Python/2.7/site-packages/thrift/protocol/TBinaryProtocol.py", line 126, in readMessageBegin
> sz = self.readI32()
> File "/Library/Python/2.7/site-packages/thrift/protocol/TBinaryProtocol.py", line 203, in readI32
> buff = self.trans.readAll(4)
> File "/Library/Python/2.7/site-packages/thrift/transport/TTransport.py", line 58, in readAll
> chunk = self.read(sz-have)
> File "/Library/Python/2.7/site-packages/thrift/transport/TTransport.py", line 272, in read
> self.readFrame()
> File "/Library/Python/2.7/site-packages/thrift/transport/TTransport.py", line 276, in readFrame
> buff = self.__trans.readAll(4)
> File "/Library/Python/2.7/site-packages/thrift/transport/TTransport.py", line 58, in readAll
> chunk = self.read(sz-have)
> File "/Library/Python/2.7/site-packages/thrift/transport/TSocket.py", line 108, in read
> raise TTransportException(type=TTransportException.END_OF_FILE, message='TSocket read 0 bytes')
> thrift.transport.TTransport.TTransportException: TSocket read 0 bytes
>
> Parts of my thrift file.
>
> struct Hardware {
> 1:i16 physicalCpus,
> 2:i16 logicalCpus
> 3:i32 totalRamMb
> 4:i32 freeRamMb,
> 5:i32 totalSwapMb,
> 6:i32 freeSwapMb,
> 7:string cpuModel,
> 8:string platform
> }
>
> struct Ping {
> 1:string hostname,
> 2:string ipAddr,
> 3:bool isReboot,
> 4:i64 bootTime,
> 5:Hardware hw,
> 6:list<RunningTask> tasks;
> }
>
> service RndServiceApi {
> void sendPing(1:Ping ping) throws (1:RndException e),
> }
>
> Java server code:
>
> transport = new TNonblockingServerSocket(port);
> server = new TThreadedSelectorServer(
> new TThreadedSelectorServer.Args(transport)
> .processor(processor)
> .workerThreads(8)
> .selectorThreads(4)
> .protocolFactory(new TBinaryProtocol.Factory(true, true))
> .transportFactory(new TFramedTransport.Factory()));
>
> Python client code:
>
> host, port = conf.PLOW_HOSTS[0].split(":")
> socket = TSocket.TSocket(host, int(port))
> transport = TTransport.TFramedTransport(socket)
> protocol = TBinaryProtocol.TBinaryProtocol(transport)
> service = RndServiceApi.Client(protocol)
> transport.open()
>
>
>