Code example for InvocationTargetException

Methods: getMessagegetCause

0
 
    private XPathEvaluator createEvaluator(String xpath2) {
        try { 
            return (XPathEvaluator)EVALUATOR_CONSTRUCTOR.newInstance(new Object[] {xpath, builder});
        } catch (InvocationTargetException e) {
            Throwable cause = e.getCause();
            if (cause instanceof RuntimeException) {
                throw (RuntimeException)cause;
            } 
            throw new RuntimeException("Invalid XPath Expression: " + xpath + " reason: " + e.getMessage(), e);
        } catch (Throwable e) {
            throw new RuntimeException("Invalid XPath Expression: " + xpath + " reason: " + e.getMessage(), e);
        } 
    } 
 
    public Object evaluate(MessageEvaluationContext message) throws JMSException {
        try { 
            if (message.isDropped()) {
                return null; 
            }