如何在Maven中看到完整的StackTrace?

时间:2016-06-17 01:34:52

标签: java maven stack trace

我使用Maven运行一个类,我得到以下StackTrace:

[INFO] --- exec-maven-plugin:1.5.0:java (default-cli) @ ws-app-client ---
java.lang.RuntimeException: es.udc.ws.app.xml.ParsingException: java.lang.NullPointerException
    at es.udc.ws.app.client.service.rest.RestClientDealService.reserveDeal(RestClientDealService.java:166)
    at es.udc.ws.app.client.ui.DealServiceClient.main(DealServiceClient.java:190)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.codehaus.mojo.exec.ExecJavaMojo$1.run(ExecJavaMojo.java:294)
    at java.lang.Thread.run(Thread.java:745)
Caused by: es.udc.ws.app.xml.ParsingException: java.lang.NullPointerException
    at es.udc.ws.app.xml.XmlExceptionConversor.fromInstanceNotFoundExceptionXml(XmlExceptionConversor.java:106)
    at es.udc.ws.app.client.service.rest.RestClientDealService.validateStatusCode(RestClientDealService.java:283)
    at es.udc.ws.app.client.service.rest.RestClientDealService.reserveDeal(RestClientDealService.java:159)
    ... 7 more
Caused by: java.lang.NullPointerException
    at es.udc.ws.app.xml.XmlExceptionConversor.fromInstanceNotFoundExceptionXml(XmlExceptionConversor.java:101)
    ... 9 more

如何查看7和9个错误?

我尝试使用-DtrimStackTrace=false-e -X开关执行课程,但它不起作用。有什么建议吗?

1 个答案:

答案 0 :(得分:1)

7和9省略的行在第一部分中。这告诉你的是,堆栈跟踪与之前的堆栈跟踪相同。

在这种情况下,实际原因是在ParsingException

中捕获并包裹(重新抛出)的NPE