Code example for InvocationTargetException

Methods: getMessage

0
			return result;
		} catch (IllegalAccessException e) {
			throw new NoSuchMethodException(methodName + " is not accessible");
		} catch (InvocationTargetException e) {
			// The method is not supposed to throw exceptions 
			throw new InternalError(e.getMessage());
		} 
	} 
 
	/** 
	 * Invokes the specified accessible method with a string parameter if it exists. 
	 * 
	 * @param obj				 The object on which to invoke the method. 
	 * @param methodName		The name of the method. 
	 * @param stringParameter The String parameter 
	 * @return NoSuchMethodException if the method does not exist or is not accessible. 
	 * @throws NoSuchMethodException 
	 */ 
	public static Object invoke(Object obj, String methodName, String stringParameter)
			  throws NoSuchMethodException { 
		try {