我正在使用 Method.invoke() 调用第三方 jar 中的函数。有时我会抛出 java.lang.reflect.InvocationTargetException。您如何从中找出真正的异常是什么?
最佳答案
InvocationTargetException.getCause() 它使用 1.4 中引入的正常异常链接内容
关于java.lang.reflect.InvocationTargetException - 确定实际错误?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1823284/