RFC: Netx - Fix service exceptions thrown by the proxy

Deepak Bhole dbhole at redhat.com
Tue Jun 16 06:42:51 PDT 2009


* Omair Majid <omajid at redhat.com> [2009-06-15 16:39]:
> Hi,
>
> Netx uses dynamic proxies to wrap all calls to the various JNLP services  
> and run them in privileged mode. If any method called throws an  
> exception, it is wrapped in a InvocationTargetException. And then in a  
> PrivilegedActionException. Now a client JNLP program doesnt know (and  
> shouldnt know!) that we are using proxies. So it gets a totally  
> unexpected exception and cant deal with the situation properly. [1]  
> describes the bug in much more detail.
>
> The attached patch fixes the problem by throwing the exception that  
> caused the problem.
>


Looks good. Can you change the getCause() in case of ITE to be
getTargetException instead? From the last line on the link you posted:

One commenter noted that InvocationTargetException.getTargetException()
should be used instead of getCause(). The two methods are actually
equivalent for InvocationTargetException, so using either works.

After above change, good to commit.

Cheers,
Deepak

> ChangeLog:
> 2009-10-15  Omair Majid  <omajid at redhat.com>
>
>    * rt/net/sourceforge/jnlp/services/ServiceUtil.java:
>    (invoke): Throw the exception that caused the problem.
>
>
> [1]  
> http://benpryor.com/blog/2006/08/15/java-dynamic-proxies-and-invocationtargetexception/





More information about the distro-pkg-dev mailing list