[
https://issues.apache.org/jira/browse/TUSCANY-2225?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12588532#action_12588532
]
Mark Combellack commented on TUSCANY-2225:
--
The problem actually comes from the use of the
org.apache.tuscany.sca.core.invocation.NonBlockingInterceptor from the core
module.
The code contains the following in the invoke method:
workScheduler.scheduleWork(new Runnable() {
public void run() {
Message context =
ThreadMessageContext.setMessageContext(msg);
try {
next.invoke(msg);
} finally {
ThreadMessageContext.setMessageContext(context);
}
}
});
The code will:
1) Use the WorkSchedular to run the @OneWay operation in a separate thread.
2) That separate thread will call next.invoke(msg) which will return the result
of running the @OneWay invocation
3) The return value from next.invoke() will be the result message (will call it
result). Since the @OneWay method threw an Exception, result.isFault() is true
4) The above code does not bother to check the result to see if it is an
exception. It just completely ignores the return value.
What the code should do is check whether the return value from
next.invoke(msg) indicates an exception. If it does, then it should handle it
appropriately.
> RuntimeExceptions thrown by @OneWay methods are not logged anywhere
> ---
>
> Key: TUSCANY-2225
> URL: https://issues.apache.org/jira/browse/TUSCANY-2225
> Project: Tuscany
> Issue Type: Bug
> Components: Java SCA Core Runtime
>Affects Versions: Java-SCA-Next
> Environment: trunk svn revision 647147
> Linux
>Reporter: Mark Combellack
>Assignee: Mark Combellack
> Fix For: Java-SCA-Next
>
>
> If a @OneWay method throws a RuntimeException, the exception is lost. It is
> not logged anywhere and there is no way to tell it has happened. This makes
> it extremely hard for a developer to debug problems with @OneWay methods in
> their applications.
> The client code that invokes the @OneWay method will not be told of the
> failure as per the contract of the @OneWay scemantics.
> However, the fact that the exception occurred should be recorded somwhere so
> the developer can attempt to diagnose the problem.
--
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]