Since the transporters use the Java reflection API to make remote calls and the "invoke" method of the class "Method" wraps all user defined exceptions of the underlying method in an "InvocationTargetException", I think it would be useful to catch this exception in the TransporterClient and rethrow only the user defined exception. In this case the user of the TransporterClient would only see his own exceptions and must not care about the exceptions thrown by the reflection API.
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { String methodName = method.getName(); String[] paramSig = createParamSignature(method.getParameterTypes()); NameBasedInvocation request = new NameBasedInvocation(methodName, args, paramSig); try { return remotingClient.invoke(request); } catch (InvocationTargetException e) { throw e.getCause(); } }
Ok. Thanks for letting me know. It has been fixed per jira issus JBREM-276.