Code example for InvocationTargetException

Methods: getCause

        try { 
            return m.invoke(target, parameter);
        } catch (IllegalAccessException e) {
            throw new MessageHandlerInvocationException("Access to the message handler method was denied.", e);
        } catch (InvocationTargetException e) {
            if (e.getCause() instanceof RuntimeException) {
                throw (RuntimeException) e.getCause();
            throw new MessageHandlerInvocationException("An exception occurred while invoking the handler method.", e);
     * Finds the handler method that can handle the given <code>message</code>, or <code>null</code> if no such handler 
     * exists. 
     * @param message The message to find a handler for 
     * @return The handler for the given message, or <code>null</code> if none exists 
    public MethodMessageHandler findHandlerMethod(Message message) {
Contextual code suggestions in your IDE  Get Codota for Java