【异常解决】Constructs a InvocationTargetEXception with a target exception

【错误解决】Constructs a InvocationTargetEXception with a target exception调试程序,遇到:Constructs a

【错误解决】Constructs a InvocationTargetEXception with a target exception

调试程序,遇到:Constructs a InvocationTargetEXception with a target exception

?

在 java.lang.reflect包中的InvocationTargetException.java类中的InvocationTargetException;

?

解释说是系统在创建一个类,在构造函数中就出错;

?

发现:除了构造函数,创建类的实例出错都会报这个错误;

如有一个成员变量:在定义的时候直接new出来,结果有Exception,也报这个错误