Code example for InvocationTargetException

Methods: getCause

0
			try{ 
				return method.invoke(wrapped, args);
			} catch (InvocationTargetException e) {
				// We must catch InvocationTargetException to avoid UndeclaredThrowableExceptions 
				// see: http://amitstechblog.wordpress.com/2011/07/24/java-proxies-and-undeclaredthrowableexception/ 
				throw e.getCause();
			} finally{ 
				long elapse = System.currentTimeMillis()-start;
				if(log.isTraceEnabled()){
					log.trace(String.format(MESSAGE_TEMPALTE, method.getName(), elapse));
				} 
			} 
		} 
		 
	} 
}