Return-Path: X-Original-To: apmail-thrift-dev-archive@www.apache.org Delivered-To: apmail-thrift-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id BC03E9BEA for ; Sat, 28 Jan 2012 15:17:35 +0000 (UTC) Received: (qmail 61620 invoked by uid 500); 28 Jan 2012 15:17:35 -0000 Delivered-To: apmail-thrift-dev-archive@thrift.apache.org Received: (qmail 61343 invoked by uid 500); 28 Jan 2012 15:17:34 -0000 Mailing-List: contact dev-help@thrift.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@thrift.apache.org Delivered-To: mailing list dev@thrift.apache.org Received: (qmail 61281 invoked by uid 99); 28 Jan 2012 15:17:34 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 28 Jan 2012 15:17:34 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 28 Jan 2012 15:17:31 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id 25861169D32 for ; Sat, 28 Jan 2012 15:17:10 +0000 (UTC) Date: Sat, 28 Jan 2012 15:17:10 +0000 (UTC) From: "Francesco Capponi (Updated) (JIRA)" To: dev@thrift.apache.org Message-ID: <725002094.4541.1327763830155.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <1465007737.4539.1327763830031.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Updated] (THRIFT-1511) Server with oneway support ( JAVA ) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/THRIFT-1511?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Francesco Capponi updated THRIFT-1511: -------------------------------------- Labels: (was: patch) Description: Thrift file: ( client to java Server ) service myService { oneway void info ( 1:i32 server_id ) } When I make a request with info, on the java server I get this error: 22:16:12.553 [pool-3-thread-5] ERROR o.a.thrift.server.TThreadPoolServer - Error occurred during processing of message. java.lang.NullPointerException: null at org.apache.thrift.ProcessFunction.process(ProcessFunction.java:34) ~[libthrift-0.9.0-snapshot.jar:0.9.0-snapshot] at org.apache.thrift.TBaseProcessor.process(TBaseProcessor.java:34) ~[libthrift-0.9.0-snapshot.jar:0.9.0-snapshot] at org.apache.thrift.server.TThreadPoolServer$WorkerProcess.run(TThreadPoolServer.java:176) ~[libthrift-0.9.0-snapshot.jar:0.9.0-snapshot] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) [na:1.7.0_01] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) [na:1.7.0_01] at java.lang.Thread.run(Thread.java:722) [na:1.7.0_01] On line 34 of ProcessFunction we have: result.write(oprot); but result is null, becouse when the func is oneway, getResult's response is always null TBase result = getResult(iface, args); oprot.writeMessageBegin(new TMessage(getMethodName(), TMessageType.REPLY, seqid)); result.write(oprot); getResult funcion is: public info_result getResult(I iface, info_args args) throws org.apache.thrift.TException { iface.info(args.server_id); return null; } instead without oneway it is: public info_result getResult(I iface, info_args args) throws org.apache.thrift.TException { info_result result = new info_result(); iface.info(args.server_id); return result; } was: Thrift file: ( client to java Server ) service myService { oneway void info ( 1:i32 server_id ) } When I make a request with info, on the java server I get this error: 22:16:12.553 [pool-3-thread-5] ERROR o.a.thrift.server.TThreadPoolServer - Error occurred during processing of message. java.lang.NullPointerException: null at org.apache.thrift.ProcessFunction.process(ProcessFunction.java:34) ~[libthrift-0.9.0-snapshot.jar:0.9.0-snapshot] at org.apache.thrift.TBaseProcessor.process(TBaseProcessor.java:34) ~[libthrift-0.9.0-snapshot.jar:0.9.0-snapshot] at org.apache.thrift.server.TThreadPoolServer$WorkerProcess.run(TThreadPoolServer.java:176) ~[libthrift-0.9.0-snapshot.jar:0.9.0-snapshot] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) [na:1.7.0_01] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) [na:1.7.0_01] at java.lang.Thread.run(Thread.java:722) [na:1.7.0_01] On line 34 of ProcessFunction we have: result.write(oprot); but result is null, becouse when the func is oneway, getResult's response is always null TBase result = getResult(iface, args); oprot.writeMessageBegin(new TMessage(getMethodName(), TMessageType.REPLY, seqid)); result.write(oprot); getResult funcion is: public info_result getResult(I iface, info_args args) throws org.apache.thrift.TException { iface.info(args.server_id, args.max_clients, args.DNS, args.port_TS, args.port_Thrift); return null; } > Server with oneway support ( JAVA ) > ----------------------------------- > > Key: THRIFT-1511 > URL: https://issues.apache.org/jira/browse/THRIFT-1511 > Project: Thrift > Issue Type: Bug > Components: Java - Compiler, Java - Library > Reporter: Francesco Capponi > > Thrift file: ( client to java Server ) > service myService { > oneway void info ( 1:i32 server_id ) > > } > When I make a request with info, on the java server I get this error: > 22:16:12.553 [pool-3-thread-5] ERROR o.a.thrift.server.TThreadPoolServer - Error occurred during processing of message. > java.lang.NullPointerException: null > at org.apache.thrift.ProcessFunction.process(ProcessFunction.java:34) ~[libthrift-0.9.0-snapshot.jar:0.9.0-snapshot] > at org.apache.thrift.TBaseProcessor.process(TBaseProcessor.java:34) ~[libthrift-0.9.0-snapshot.jar:0.9.0-snapshot] > at org.apache.thrift.server.TThreadPoolServer$WorkerProcess.run(TThreadPoolServer.java:176) ~[libthrift-0.9.0-snapshot.jar:0.9.0-snapshot] > at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) [na:1.7.0_01] > at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) [na:1.7.0_01] > at java.lang.Thread.run(Thread.java:722) [na:1.7.0_01] > On line 34 of ProcessFunction we have: result.write(oprot); but result is null, becouse when the func is oneway, getResult's response is always null > TBase result = getResult(iface, args); > oprot.writeMessageBegin(new TMessage(getMethodName(), TMessageType.REPLY, seqid)); > result.write(oprot); > getResult funcion is: > public info_result getResult(I iface, info_args args) throws org.apache.thrift.TException { > iface.info(args.server_id); > return null; > } > instead without oneway it is: > public info_result getResult(I iface, info_args args) throws org.apache.thrift.TException { > info_result result = new info_result(); > iface.info(args.server_id); > return result; > } -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira