在项目中遇到了invocationTargetException的问题,在这里跟大家分享一下. 报错信息如下: 使用反射时,比如执行invoke方法,如果被反射执行的方法体抛出了Exception,这个异常会被包装成invocationTargetException重新抛出. 源码解释为: InvocationTargetException is a checked exception that wraps an exception thrown by an invoked method or
反射调用方法,如果方法抛出异常,会被包装成InvocationTargetException. 如果反射对象被代理了,在代理类中抛出异常,不会被包装成InvocationTargetException. package com.loull.test.aop; public interface Person { void sayHello(); } package com.loull.test.aop; public class PersonImpl implements Person { @