我目前正在使用现有的源代码开发一个java项目。现有的用于ant的build.xml
存在,但编译和生成wsdl文件失败。
无论如何,使用ant -v
,输出仍然被切断,这让我没有足够的信息来找到问题。
发生错误的输出:
GenerateServer-Config.wsdd:
[echo] generate server-config.wsdd for webservice
[java] Exception in thread "main" java.lang.ExceptionInInitializerError
[java] at java.lang.Class.forName0(Native Method)
[java] at java.lang.Class.forName(Class.java:270)
[java] at org.apache.axis.utils.ClassUtils$2.run(ClassUtils.java:177)
[java] at java.security.AccessController.doPrivileged(Native Method)
[java] at org.apache.axis.utils.ClassUtils.loadClass(ClassUtils.java:160)
[java] at org.apache.axis.utils.ClassUtils.forName(ClassUtils.java:100)
[java] at org.apache.axis.deployment.wsdd.WSDDTypeMapping.getLanguageSpecificType(WSDDTypeMapping.java:183)
[java] at org.apache.axis.deployment.wsdd.WSDDService.deployTypeMapping(WSDDService.java:542)
[java] at org.apache.axis.deployment.wsdd.WSDDService.initTMR(WSDDService.java:253)
[java] at org.apache.axis.deployment.wsdd.WSDDService.<init>(WSDDService.java:233)
[java] at org.apache.axis.deployment.wsdd.WSDDDeployment.<init>(WSDDDeployment.java:192)
[java] at org.apache.axis.deployment.wsdd.WSDDDocument.setDocument(WSDDDocument.java:139)
[java] at org.apache.axis.deployment.wsdd.WSDDDocument.<init>(WSDDDocument.java:65)
[java] at org.apache.axis.configuration.FileProvider.configureEngine(FileProvider.java:179)
[java] at org.apache.axis.AxisEngine.init(AxisEngine.java:172)
[java] at org.apache.axis.AxisEngine.<init>(AxisEngine.java:156)
[java] at org.apache.axis.server.AxisServer.<init>(AxisServer.java:88)
[java] at org.apache.axis.server.AxisServer.<init>(AxisServer.java:83)
[java] at org.apache.axis.utils.Admin.main(Admin.java:289)
[java] Caused by: java.lang.NullPointerException
[java] at java.io.FileOutputStream.<init>(FileOutputStream.java:212)
[java] at java.io.FileOutputStream.<init>(FileOutputStream.java:142)
[java] at org.apache.log4j.FileAppender.setFile(FileAppender.java:272)
[java] at org.apache.log4j.FileAppender.<init>(FileAppender.java:96)
[java] at org.apache.log4j.FileAppender.<init>(FileAppender.java:107)
[java] at de.atip.Log.createAppender(Log.java:103)
[java] at de.atip.Log.<init>(Log.java:78)
[java] at de.atip.voxguard.UserInfo.<clinit>(UserInfo.java:33)
[java] ... 19 more
BUILD FAILED
所以我可以看到还有19条错误消息,但即使使用详细模式,ant也不会告诉我它们。有什么方法可以输出这些错误吗?
来自Throwable.printStacktrace
:的Javadoc
注意是否存在包含字符"…"的行指示此异常的堆栈跟踪的剩余部分与堆栈底部的指定帧数相匹配由该异常引起的异常的跟踪("封闭"异常)。这种简写可以大大缩短长度在引发包装异常的常见情况下的输出的从和"原因异常"相同的方法捕获。
换句话说,NullPointerException
的其余堆栈跟踪与ExceptionInInitializerError
的跟踪相同。