[ 
https://issues.apache.org/jira/browse/THRIFT-1658?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13422591#comment-13422591
 ] 

Keith Turner commented on THRIFT-1658:
--------------------------------------

Here is a link to the diff.

https://svn.apache.org/viewvc/thrift/branches/0.8.x/compiler/cpp/src/generate/t_java_generator.cc?r1=1063907&r2=1068487

The part of the diff that I think causing this issue is below.

{noformat}
@@ -2839,42 +2725,18 @@
         f_service_ << "}";
       }
     }
-    f_service_ << " catch (Throwable th) {" << endl;
-    indent_up();
-    f_service_ <<
-      indent() << "LOGGER.error(\"Internal error processing " << 
tfunction->get_name() << "\", th);" << endl <<
-      indent() << "org.apache.thrift.TApplicationException x = new 
org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR,
 \"Internal error processing " << tfunction->get_name() << "\");" << endl <<
-      indent() << "oprot.writeMessageBegin(new 
org.apache.thrift.protocol.TMessage(\"" << tfunction->get_name() << "\", 
org.apache.thrift.protocol.TMessageType.EXCEPTION, seqid));" << endl <<
-      indent() << "x.write(oprot);" << endl <<
-      indent() << "oprot.writeMessageEnd();" << endl <<
-      indent() << "oprot.getTransport().flush();" << endl <<
-      indent() << "return;" << endl;
-    indent_down();
-    f_service_ << indent() << "}" << endl;
+    f_service_ << endl;
   }
{noformat}

Maybe this functionality was supposed to be moved to libthrift.jar but did not 
make it?
                
> Java thrift server is not throwing TApplicationException
> --------------------------------------------------------
>
>                 Key: THRIFT-1658
>                 URL: https://issues.apache.org/jira/browse/THRIFT-1658
>             Project: Thrift
>          Issue Type: Bug
>          Components: Java - Compiler, Java - Library
>    Affects Versions: 0.7, 0.8
>            Reporter: Keith Turner
>            Assignee: Jake Farrell
>
> When using thrift to communicate between Java clients and servers, I am no 
> longer seeing TApplicationExceptions when an unexpected exception is thrown 
> on the servers side.
> Thrift 0.6 works, but thrift 0.8 does not.  Looking at the Processor code 
> generated by 0.6 it catches Throwable and returns a TApplication exception to 
> the client.  The Processor code generated by 0.8 does not do this.

--
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

        

Reply via email to