[ 
https://issues.apache.org/jira/browse/TUSCANY-1802?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12529771
 ] 

gengshaoguang commented on TUSCANY-1802:
----------------------------------------

Hi,Yang,
My opinion of your request is that the "original" exception got wrapped is 
because of the class hierarchy, the method can not throw exception types else.

And, wrapping the exception will not prevent you from knowing the original one! 
Am I right?

Good Luck


> RMI Implementation Error Handling lost inner exception's detail information
> ---------------------------------------------------------------------------
>
>                 Key: TUSCANY-1802
>                 URL: https://issues.apache.org/jira/browse/TUSCANY-1802
>             Project: Tuscany
>          Issue Type: Bug
>          Components: Java SCA Java Implementation Extension
>            Reporter: Yang Sun
>             Fix For: Java-SCA-0.99
>
>
> Here is an email I sent to the tuscany user group. Raymond Feng confirms it 
> may be a potential bug. Please have a look.
> /--------------------------------------
> Hi,
> I am a new user of Tuscany and I am very excited with this great software. I 
> am trying to introduce it into my project and currently I am evaluate it with 
> every possible situations. 
> Currently, I met a small problem with the spring implementation. I am not 
> sure if I understand the background and configure the composites right. 
> Please correct me if I make anything wrong. 
> The problem I met is that I cannot get the detailed original exception when 
> the server-side throw any kinds of exceptions. After a rough looking at the 
> src code and debugging, I see the following code in SpringInvoker.java :
> -----------------------------------------------------------------------
>     private Object doInvoke(Object payload) throws SpringInvocationException {
>         if (theMethod == null)
>             setupMethod(); 
>         if (badInvoker)
>             throw new SpringInvocationException("Spring invoker incorrectly 
> configured");
>         // Invoke the method on the Spring bean using the payload, returning 
> the results 
>         try {
>             Object ret;
>             if (payload != null && !payload.getClass().isArray()) {
>                 ret = theMethod.invoke(bean, payload);
>             } else {
>                 ret = theMethod.invoke(bean, (Object[])payload);
>             }
>             return ret;
>         } catch (InvocationTargetException e) {
>             throw new SpringInvocationException(e.getMessage());
>         } catch (Exception e) { 
>             throw new SpringInvocationException(e.getMessage());
>         }
>     } // end method doInvoke
> ------------------------------------------------------------------------ 
> When the invoked method throw an exception (checked or unchecked), the 
> program flow will go to the InvocationTargetException exception handler. Then 
> the program only put the message of the original message to the wrapper 
> exception SpringInvocationException. The detailed information of the original 
> exception is missing. I am thinking it is here that will lost the detailed 
> information of the original exception detail. 
> The reason for me to bring this question is that if we cannot get the 
> detailed information of the original exception, how can we deal with the 
> application exceptions (such as NotEnoughMoneyException)? The only thing I 
> can get is the java.lang.reflect.InvocationTargetException wrapped in 
> java.rmi.UnexpectedException. And with those information, I cannot get the 
> right information to make the further decision in the program.
> I am not sure whether I got the right point or if I misunderstand anything. 
> Please give me some suggestions on this problem. 
> Best Regards,
> Yang Sun
> --------------------------------------------------------------------------------/

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to