thrift-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Francesco Capponi (Updated) (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (THRIFT-1511) Server with oneway support ( JAVA )
Date Sat, 28 Jan 2012 15:17:10 GMT

     [ 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

        

Mime
View raw message