RFC: Netx - Fix service exceptions thrown by the proxy
dbhole at redhat.com
Tue Jun 16 06:42:51 PDT 2009
* Omair Majid <omajid at redhat.com> [2009-06-15 16:39]:
> 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. 
> 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.
> 2009-10-15 Omair Majid <omajid at redhat.com>
> * rt/net/sourceforge/jnlp/services/ServiceUtil.java:
> (invoke): Throw the exception that caused the problem.
More information about the distro-pkg-dev