7 Replies Latest reply on Apr 10, 2008 6:57 AM by Niklas Hellberg

    Invocation exception handling

    Alessio Soldano Newbie

      Hi all,
      on jira we currently have an issue about invocation exception handling with the metro stack http://jira.jboss.com/jira/browse/JBWS-1670.
      Basically the problem is caused by the handleInvocationException method of the abstract class org.jboss.wsf.spi.invocation.InvocationHandler that unwraps the throwable raised by the service endpoint implementation:

      if (th instanceof InvocationTargetException)
       {
       // Unwrap the throwable raised by the service endpoint implementation
       Throwable targetEx = ((InvocationTargetException)th).getTargetException();
       handleInvocationException(targetEx);
       }
      

      This is correct for the native stack, but causes the Metro stack integration to fail whenever a custom user exception is thrown, since the unwrapping process is perfomed twice (both by metro and jbossws code above).

      This drove me to think that the InvocationHandler might delegate the exception handling process to an InvocationExceptionHandler which is going to be different for each stack (for now, the native one would unwrap InvocationExceptions, the metro one would not).
      The EndpointHandlerDeploymentAspect could set the right InvocationExceptionHandler (according to the jbossws-xxx-config.xml) into every InvocationHandler (regardless of its type, the container we are running on, etc).

      Any opinion about this?
      Bye
      Alessio Soldano