Java Code Examples for org.springframework.remoting.support.RemoteInvocationUtils

The following examples show how to use org.springframework.remoting.support.RemoteInvocationUtils. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: cuba   Source File: HttpServiceProxy.java    License: Apache License 2.0 6 votes vote down vote up
@Override
protected Object recreateRemoteInvocationResult(RemoteInvocationResult result) throws Throwable {
    Throwable throwable = result.getException();
    if (throwable != null) {
        if (throwable instanceof InvocationTargetException)
            throwable = ((InvocationTargetException) throwable).getTargetException();
        if (throwable instanceof RemoteException) {
            Exception exception = ((RemoteException) throwable).getFirstCauseException();
            // This is a checked exception declared in a service method
            // or runtime exception supported by client
            if (exception != null) {
                RemoteInvocationUtils.fillInClientStackTraceIfPossible(exception);
                throw exception;
            }
        }
    }
    return super.recreateRemoteInvocationResult(result);
}