Both two methods handle InvocationTargetException from Endpoint @OnMessage method like this: try { result = method.invoke(pojo, parameters); } catch (IllegalAccessException | InvocationTargetException e) { throw new IllegalArgumentException(e); } I'd like to suggest to use org.apache.tomcat.util.ExceptionUtils#unwrapInvocationTargetException() and RuntimeException , which is like below: try { result = method.invoke(pojo, parameters); } catch (IllegalAccessException | InvocationTargetException e) { Throwable throwable = ExceptionUtils.unwrapInvocationTargetException(e); if (throwable instanceof RuntimeException) { throw (RuntimeException) throwable; } else { throw new RuntimeException(throwable); } }
Thanks for the report. I have applied a variation of this to 8.0.x for 8.0.9 onwards.
The fix was back-ported to 7.0.x for 7.0.56 onwards.