You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avro.apache.org by "Doug Cutting (Resolved) (JIRA)" <ji...@apache.org> on 2011/10/07 22:44:30 UTC

[jira] [Resolved] (AVRO-914) SpecificResponder casts Throwable to Exception; fails for OutOfMemoryError

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

Doug Cutting resolved AVRO-914.
-------------------------------

       Resolution: Fixed
    Fix Version/s: 1.6.0
         Assignee: Philip Zeyliger

Looks good to me.  I committed it.  Thanks, Philip!
                
> SpecificResponder casts Throwable to Exception; fails for OutOfMemoryError
> --------------------------------------------------------------------------
>
>                 Key: AVRO-914
>                 URL: https://issues.apache.org/jira/browse/AVRO-914
>             Project: Avro
>          Issue Type: Bug
>            Reporter: Philip Zeyliger
>            Assignee: Philip Zeyliger
>             Fix For: 1.6.0
>
>         Attachments: AVRO-914.patch.txt
>
>
> I have the following stack frame in an application i'm working with:
> {quote}
> java.lang.ClassCastException: java.lang.OutOfMemoryError cannot be cast to java.lang.Exception 
> at org.apache.avro.ipc.specific.SpecificResponder.respond(SpecificResponder.java:90) 
> at org.apache.avro.ipc.Responder.respond(Responder.java:149) 
> at org.apache.avro.ipc.SocketServer$Connection.run(SocketServer.java:116) 
> at java.lang.Thread.run(Thread.java:662)
> {quote}
> Nothing too surprising, here's the code:
> {noformat}
>   @Override
>   public Object respond(Message message, Object request) throws Exception {
> ...
>     } catch (InvocationTargetException e) {
>       throw (Exception)e.getTargetException();
> ...
> {noformat}
> It's probably a bug that this ends up with a ClassCastException.  Any suggestions?  I don't think we can change the signature to Exception.  We could check instanceof and wrap the Throwable if it's not an Exception?

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