从控制台运行java应用程序时遇到异常,其中包含以下行:
... 5更多
是否可以看到完整的痕迹?有没有cmd参数?
感谢。
答案 0 :(得分:13)
完整的跟踪是存在的,但它是上面嵌套异常的重复,这就是它被总结的原因。
public class Main {
public static void throwsException() {
throw new UnsupportedOperationException();
}
public static void main(String... args) throws NoSuchMethodException, InvocationTargetException, IllegalAccessException {
Main.class.getMethod("throwsException").invoke(null);
}
}
打印
Exception in thread "main" java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at Main.main(Main.java:27)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)
Caused by: java.lang.UnsupportedOperationException
at Main.throwsException(Main.java:23)
... 10 more
... 10 more
表示它是包装它的异常的堆栈跟踪的重复。