RFC: Netx - Fix service exceptions thrown by the proxy

Omair Majid omajid at redhat.com
Tue Jun 16 09:27:09 PDT 2009


Deepak Bhole wrote:
> * Omair Majid <omajid at redhat.com> [2009-06-16 09:57]:
>> Deepak Bhole wrote:
>>> * 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.
>> I was going to use getTargetException() but then I saw this note in the  
>> java-docs [1]: "The Throwable.getCause() method is now the preferred  
>> means of obtaining this information". I have no preference either way;  
>> what do you think makes more sense?
>>
> 
> Ah okay. Javadocs is the preferred source of info. What you have is the
> right way then, no need to change anything.
> 

Committed as:
changeset 450de765ec22 in /hg/icedtea6
details: 
http://icedtea.classpath.org/hg/icedtea6?cmd=changeset;node=450de765ec22
description:
	2009-06-16  Omair Majid  <omajid at redhat.com>

	    * rt/net/sourceforge/jnlp/services/ServiceUtil.java:
	    (invoke): Throw the original exception that caused the
             problem.


Thanks,
Omair



More information about the distro-pkg-dev mailing list