Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 354718 - Replacing a thrown exception from an executing remote service
Summary: Replacing a thrown exception from an executing remote service
Status: RESOLVED FIXED
Alias: None
Product: Riena
Classification: RT
Component: communication (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 7
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Stefan Liebig CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 322701
Blocks:
  Show dependency tree
 
Reported: 2011-08-15 05:01 EDT by Stefan Liebig CLA
Modified: 2011-08-15 05:17 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Stefan Liebig CLA 2011-08-15 05:01:26 EDT
For a Riena based application that we are currently creating we have the problem that a remote service may throw (runtime) exceptions (javax.persistence.*) which are unknown on the client side.  Since Riena uses the Hessian protocol for remote service invocation such an exception would also be serialized and transferred to the client. And this will fail if the exception class is not "available" ("classpath") on the client.
It would be nice to have a possibility on the server to exchange the "alien" exception with a "friendly" exception.
Comment 1 Stefan Liebig CLA 2011-08-15 05:17:26 EDT
Riena has the concept of call and service hooks. Call hooks will be executed before and after a remote service call has been initiated from the client and service hooks will be called before and after the remote service call on the server side. Both before and after call will be passed a service context object created for this call. This service context contains information like the service description but also information regarding the current communication like http headers.

The service context has now been extended so that it can contain a possible target exception that has be thrown when executing the remote service. With this it is now possible that a service hook may check this exception and replace it with a different one. And the replaced exception will be thrown instead of the original exception.