You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "Ihor Mysak (Created) (JIRA)" <ji...@apache.org> on 2011/12/05 22:14:40 UTC
[jira] [Created] (THRIFT-1447) NullpointerException in
ProcessFunction.class :in "oneway" method
NullpointerException in ProcessFunction.class :in "oneway" method
-----------------------------------------------------------------
Key: THRIFT-1447
URL: https://issues.apache.org/jira/browse/THRIFT-1447
Project: Thrift
Issue Type: Bug
Components: Java - Library
Affects Versions: 0.8
Environment: Mac OS X Lion 10.7.2
java version "1.6.0_29"
Java(TM) SE Runtime Environment (build 1.6.0_29-b11-402-11M3527)
Java HotSpot(TM) 64-Bit Server VM (build 20.4-b02-402, mixed mode)
Reporter: Ihor Mysak
lines 31-36 of ProcessFunction.class:
iprot.readMessageEnd();
TBase result = getResult(iface, args);
oprot.writeMessageBegin(new TMessage(getMethodName(), TMessageType.REPLY, seqid));
result.write(oprot);
oprot.writeMessageEnd();
oprot.getTransport().flush();
problem in case where result == null;
getResult(..) for my "oneway" method(generated code) :
@Override
protected org.apache.thrift.TBase getResult(final I iface, final processUA_args args) throws org.apache.thrift.TException {
iface.processUA(args.appIdNames, args.platform);
return null;
}
so it always return null, and crash on 34 lines(ProcessFunction.class)
--
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
[jira] [Commented] (THRIFT-1447) NullpointerException in
ProcessFunction.class :in "oneway" method
Posted by "Hudson (Commented) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/THRIFT-1447?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13208406#comment-13208406 ]
Hudson commented on THRIFT-1447:
--------------------------------
Integrated in Thrift #406 (See [https://builds.apache.org/job/Thrift/406/])
THRIFT-1447. java: NullpointerException in ProcessFunction.class :in 'oneway' method
Patch: Ihor Mysak (Revision 1244272)
Result = SUCCESS
bryanduxbury : http://svn.apache.org/viewvc/?view=rev&rev=1244272
Files :
* /thrift/trunk/compiler/cpp/src/generate/t_java_generator.cc
* /thrift/trunk/lib/java/src/org/apache/thrift/ProcessFunction.java
> NullpointerException in ProcessFunction.class :in "oneway" method
> -----------------------------------------------------------------
>
> Key: THRIFT-1447
> URL: https://issues.apache.org/jira/browse/THRIFT-1447
> Project: Thrift
> Issue Type: Bug
> Components: Java - Library
> Affects Versions: 0.8
> Environment: Mac OS X Lion 10.7.2
> java version "1.6.0_29"
> Java(TM) SE Runtime Environment (build 1.6.0_29-b11-402-11M3527)
> Java HotSpot(TM) 64-Bit Server VM (build 20.4-b02-402, mixed mode)
> Reporter: Ihor Mysak
> Assignee: Ihor Mysak
> Priority: Blocker
> Fix For: 0.9
>
> Attachments: onewayfix.patch
>
>
> lines 31-36 of ProcessFunction.class:
> iprot.readMessageEnd();
> TBase result = getResult(iface, args);
> oprot.writeMessageBegin(new TMessage(getMethodName(), TMessageType.REPLY, seqid));
> result.write(oprot);
> oprot.writeMessageEnd();
> oprot.getTransport().flush();
> problem in case where result == null;
> getResult(..) for my "oneway" method(generated code) :
> @Override
> protected org.apache.thrift.TBase getResult(final I iface, final processUA_args args) throws org.apache.thrift.TException {
> iface.processUA(args.appIdNames, args.platform);
> return null;
> }
> so it always return null, and crash on 34 lines(ProcessFunction.class)
--
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
[jira] [Closed] (THRIFT-1447) NullpointerException in
ProcessFunction.class :in "oneway" method
Posted by "Bryan Duxbury (Closed) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/THRIFT-1447?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Bryan Duxbury closed THRIFT-1447.
---------------------------------
Resolution: Fixed
Assignee: Ihor Mysak
I just committed this. Thanks for the patch, Ihor!
> NullpointerException in ProcessFunction.class :in "oneway" method
> -----------------------------------------------------------------
>
> Key: THRIFT-1447
> URL: https://issues.apache.org/jira/browse/THRIFT-1447
> Project: Thrift
> Issue Type: Bug
> Components: Java - Library
> Affects Versions: 0.8
> Environment: Mac OS X Lion 10.7.2
> java version "1.6.0_29"
> Java(TM) SE Runtime Environment (build 1.6.0_29-b11-402-11M3527)
> Java HotSpot(TM) 64-Bit Server VM (build 20.4-b02-402, mixed mode)
> Reporter: Ihor Mysak
> Assignee: Ihor Mysak
> Priority: Blocker
> Fix For: 0.9
>
> Attachments: onewayfix.patch
>
>
> lines 31-36 of ProcessFunction.class:
> iprot.readMessageEnd();
> TBase result = getResult(iface, args);
> oprot.writeMessageBegin(new TMessage(getMethodName(), TMessageType.REPLY, seqid));
> result.write(oprot);
> oprot.writeMessageEnd();
> oprot.getTransport().flush();
> problem in case where result == null;
> getResult(..) for my "oneway" method(generated code) :
> @Override
> protected org.apache.thrift.TBase getResult(final I iface, final processUA_args args) throws org.apache.thrift.TException {
> iface.processUA(args.appIdNames, args.platform);
> return null;
> }
> so it always return null, and crash on 34 lines(ProcessFunction.class)
--
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
[jira] [Commented] (THRIFT-1447) NullpointerException in
ProcessFunction.class :in "oneway" method
Posted by "Jake Farrell (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/THRIFT-1447?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13421417#comment-13421417 ]
Jake Farrell commented on THRIFT-1447:
--------------------------------------
I am waiting on a couple tickets to get finished which are currently being worked on before making the 0.9rc, should be available soon
> NullpointerException in ProcessFunction.class :in "oneway" method
> -----------------------------------------------------------------
>
> Key: THRIFT-1447
> URL: https://issues.apache.org/jira/browse/THRIFT-1447
> Project: Thrift
> Issue Type: Bug
> Components: Java - Library
> Affects Versions: 0.8
> Environment: Mac OS X Lion 10.7.2
> java version "1.6.0_29"
> Java(TM) SE Runtime Environment (build 1.6.0_29-b11-402-11M3527)
> Java HotSpot(TM) 64-Bit Server VM (build 20.4-b02-402, mixed mode)
> Reporter: Ihor Mysak
> Assignee: Ihor Mysak
> Priority: Blocker
> Fix For: 0.9
>
> Attachments: onewayfix.patch
>
>
> lines 31-36 of ProcessFunction.class:
> iprot.readMessageEnd();
> TBase result = getResult(iface, args);
> oprot.writeMessageBegin(new TMessage(getMethodName(), TMessageType.REPLY, seqid));
> result.write(oprot);
> oprot.writeMessageEnd();
> oprot.getTransport().flush();
> problem in case where result == null;
> getResult(..) for my "oneway" method(generated code) :
> @Override
> protected org.apache.thrift.TBase getResult(final I iface, final processUA_args args) throws org.apache.thrift.TException {
> iface.processUA(args.appIdNames, args.platform);
> return null;
> }
> so it always return null, and crash on 34 lines(ProcessFunction.class)
--
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
[jira] [Commented] (THRIFT-1447) NullpointerException in
ProcessFunction.class :in "oneway" method
Posted by "Andre Reiter (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/THRIFT-1447?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13421383#comment-13421383 ]
Andre Reiter commented on THRIFT-1447:
--------------------------------------
hi guys
the error seams to be fixed since 14.Feb, so the next version 0.9 will contain it
the question now is, when is the 0.9 going to be released??? this BUG is a blocker!
> NullpointerException in ProcessFunction.class :in "oneway" method
> -----------------------------------------------------------------
>
> Key: THRIFT-1447
> URL: https://issues.apache.org/jira/browse/THRIFT-1447
> Project: Thrift
> Issue Type: Bug
> Components: Java - Library
> Affects Versions: 0.8
> Environment: Mac OS X Lion 10.7.2
> java version "1.6.0_29"
> Java(TM) SE Runtime Environment (build 1.6.0_29-b11-402-11M3527)
> Java HotSpot(TM) 64-Bit Server VM (build 20.4-b02-402, mixed mode)
> Reporter: Ihor Mysak
> Assignee: Ihor Mysak
> Priority: Blocker
> Fix For: 0.9
>
> Attachments: onewayfix.patch
>
>
> lines 31-36 of ProcessFunction.class:
> iprot.readMessageEnd();
> TBase result = getResult(iface, args);
> oprot.writeMessageBegin(new TMessage(getMethodName(), TMessageType.REPLY, seqid));
> result.write(oprot);
> oprot.writeMessageEnd();
> oprot.getTransport().flush();
> problem in case where result == null;
> getResult(..) for my "oneway" method(generated code) :
> @Override
> protected org.apache.thrift.TBase getResult(final I iface, final processUA_args args) throws org.apache.thrift.TException {
> iface.processUA(args.appIdNames, args.platform);
> return null;
> }
> so it always return null, and crash on 34 lines(ProcessFunction.class)
--
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
[jira] [Commented] (THRIFT-1447) NullpointerException in
ProcessFunction.class :in "oneway" method
Posted by "Bryan Duxbury (Commented) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/THRIFT-1447?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13168607#comment-13168607 ]
Bryan Duxbury commented on THRIFT-1447:
---------------------------------------
Hm, this is interesting. It must have gotten changed when we refactored this part of the code a while ago, otherwise oneway functions would never have worked. We probably need to be smart about this - if a non-oneway method returns null, it should be an exception.
> NullpointerException in ProcessFunction.class :in "oneway" method
> -----------------------------------------------------------------
>
> Key: THRIFT-1447
> URL: https://issues.apache.org/jira/browse/THRIFT-1447
> Project: Thrift
> Issue Type: Bug
> Components: Java - Library
> Affects Versions: 0.8
> Environment: Mac OS X Lion 10.7.2
> java version "1.6.0_29"
> Java(TM) SE Runtime Environment (build 1.6.0_29-b11-402-11M3527)
> Java HotSpot(TM) 64-Bit Server VM (build 20.4-b02-402, mixed mode)
> Reporter: Ihor Mysak
> Fix For: 0.9
>
>
> lines 31-36 of ProcessFunction.class:
> iprot.readMessageEnd();
> TBase result = getResult(iface, args);
> oprot.writeMessageBegin(new TMessage(getMethodName(), TMessageType.REPLY, seqid));
> result.write(oprot);
> oprot.writeMessageEnd();
> oprot.getTransport().flush();
> problem in case where result == null;
> getResult(..) for my "oneway" method(generated code) :
> @Override
> protected org.apache.thrift.TBase getResult(final I iface, final processUA_args args) throws org.apache.thrift.TException {
> iface.processUA(args.appIdNames, args.platform);
> return null;
> }
> so it always return null, and crash on 34 lines(ProcessFunction.class)
--
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
[jira] [Updated] (THRIFT-1447) NullpointerException in
ProcessFunction.class :in "oneway" method
Posted by "Janick Bernet (Updated) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/THRIFT-1447?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Janick Bernet updated THRIFT-1447:
----------------------------------
Attachment: onewayfix.patch
I attached a patch with a possible fix to the issue. It uses a new abstract isOneway() method in the ProcessFunction class. The method is implemented by the compiler in a sub-class. The process method only sends back a result when isOneway() returns true, otherwise it does not write anything to the output transport. This should correspond to the old (0.6 and before) behavior from what I could tell looking at the code.
> NullpointerException in ProcessFunction.class :in "oneway" method
> -----------------------------------------------------------------
>
> Key: THRIFT-1447
> URL: https://issues.apache.org/jira/browse/THRIFT-1447
> Project: Thrift
> Issue Type: Bug
> Components: Java - Library
> Affects Versions: 0.8
> Environment: Mac OS X Lion 10.7.2
> java version "1.6.0_29"
> Java(TM) SE Runtime Environment (build 1.6.0_29-b11-402-11M3527)
> Java HotSpot(TM) 64-Bit Server VM (build 20.4-b02-402, mixed mode)
> Reporter: Ihor Mysak
> Priority: Blocker
> Fix For: 0.9
>
> Attachments: onewayfix.patch
>
>
> lines 31-36 of ProcessFunction.class:
> iprot.readMessageEnd();
> TBase result = getResult(iface, args);
> oprot.writeMessageBegin(new TMessage(getMethodName(), TMessageType.REPLY, seqid));
> result.write(oprot);
> oprot.writeMessageEnd();
> oprot.getTransport().flush();
> problem in case where result == null;
> getResult(..) for my "oneway" method(generated code) :
> @Override
> protected org.apache.thrift.TBase getResult(final I iface, final processUA_args args) throws org.apache.thrift.TException {
> iface.processUA(args.appIdNames, args.platform);
> return null;
> }
> so it always return null, and crash on 34 lines(ProcessFunction.class)
--
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
[jira] [Updated] (THRIFT-1447) NullpointerException in
ProcessFunction.class :in "oneway" method
Posted by "Bryan Duxbury (Updated) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/THRIFT-1447?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Bryan Duxbury updated THRIFT-1447:
----------------------------------
Priority: Blocker (was: Major)
Fix Version/s: 0.9
> NullpointerException in ProcessFunction.class :in "oneway" method
> -----------------------------------------------------------------
>
> Key: THRIFT-1447
> URL: https://issues.apache.org/jira/browse/THRIFT-1447
> Project: Thrift
> Issue Type: Bug
> Components: Java - Library
> Affects Versions: 0.8
> Environment: Mac OS X Lion 10.7.2
> java version "1.6.0_29"
> Java(TM) SE Runtime Environment (build 1.6.0_29-b11-402-11M3527)
> Java HotSpot(TM) 64-Bit Server VM (build 20.4-b02-402, mixed mode)
> Reporter: Ihor Mysak
> Priority: Blocker
> Fix For: 0.9
>
>
> lines 31-36 of ProcessFunction.class:
> iprot.readMessageEnd();
> TBase result = getResult(iface, args);
> oprot.writeMessageBegin(new TMessage(getMethodName(), TMessageType.REPLY, seqid));
> result.write(oprot);
> oprot.writeMessageEnd();
> oprot.getTransport().flush();
> problem in case where result == null;
> getResult(..) for my "oneway" method(generated code) :
> @Override
> protected org.apache.thrift.TBase getResult(final I iface, final processUA_args args) throws org.apache.thrift.TException {
> iface.processUA(args.appIdNames, args.platform);
> return null;
> }
> so it always return null, and crash on 34 lines(ProcessFunction.class)
--
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