You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "Jake Farrell (Closed) (JIRA)" <ji...@apache.org> on 2012/01/31 04:56:10 UTC

[jira] [Closed] (THRIFT-1511) Server with oneway support ( JAVA )

     [ https://issues.apache.org/jira/browse/THRIFT-1511?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jake Farrell closed THRIFT-1511.
--------------------------------

       Resolution: Duplicate
    Fix Version/s: 0.9
         Assignee: Jake Farrell

Duplicate of THRIFT-1447
                
> 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
>            Assignee: Jake Farrell
>             Fix For: 0.9
>
>
> 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