Good day,

If this issue was already debated I am sorry but I didn't find it.

I am using hessian 4.0.3 and spring 3.0.1 (spring-remoting is the component in question here) and I ran into a big problem when using the HessianProxyFactoryBean when creating a Hessian service.

The problem resides in the class HessianClientInterceptor, which HessianProxyFactoryBean extends. Everytime I throw a business exception (which is meaningfull to my system) I get in my client side a RemoteAccessException (totally meaningless...). In order to know if it was some bug or if it was part of the business logic, I have to "unpack" this exception... I am sure you will agree this is not pretty nor is it right.

The expected behaviour of such proxy is that the exceptions declared in my service interface (normally business exceptions or of value to my business) are in fact caught directly in my client, not that they are wrapped around by some other meaningless exception.

To solve this problem we had to create a class which extended HessianProxyFactoryBean and use it to create the bean. It would be nice if the invoke method instead of wrapping the exceptions would just throw them.

this is the class we created:

Code:
public class MyHessianProxyFactoryBean extends HessianProxyFactoryBean{


  public Object invoke(MethodInvocation invocation) throws Throwable {
      try {
        return super.invoke(invocation);
      }catch(RemoteConnectFailureException e) {
        throw e;     
      } catch(RemoteAccessException e) {
        if (e.getRootCause() != null)
          throw e.getRootCause();
        else
          throw e;
      } 
  }
}
It was quite fast to make it and include it... but I would say this should be unnecessary and the way it is now is not the right behaviour. Should I open a jira issue about it or not really?