Code example for InvocationTargetException

Methods: getTargetException

0
		ClassLoader originalClassLoader = overrideThreadContextClassLoader();
		try { 
			return invocation.getMethod().invoke(this.burlapProxy, invocation.getArguments());
		} 
		catch (InvocationTargetException ex) {
			Throwable targetEx = ex.getTargetException();
			if (targetEx instanceof BurlapRuntimeException) {
				Throwable cause = targetEx.getCause();
				throw convertBurlapAccessException(cause != null ? cause : targetEx);
			} 
			else if (targetEx instanceof UndeclaredThrowableException) {
				UndeclaredThrowableException utex = (UndeclaredThrowableException) targetEx;
				throw convertBurlapAccessException(utex.getUndeclaredThrowable());
			} 
			else { 
				throw targetEx;
			} 
		} 
		catch (Throwable ex) {
			throw new RemoteProxyFailureException(