使用Ant 1.9.3运行JUnit的StackOverflowError

时间:2016-10-31 09:00:52

标签: ant ant-junit

当我使用Ant 1.9.3和Java 1.8.0_91运行我的JUnit报告生成时,它会因StackOverflowError而失败而没有明显的原因。我花了很多时间试图找出导致这种情况的原因,但到目前为止还没有运气。

有关修复/解决方法的任何想法吗?

[junitreport] Processing /var/lib/jenkins/workspace/mytest/reports/TESTS-TestSuites.xml to /var/lib/jenkins/workspace/mytest/reports/junit-noframes.html
[junitreport] Loading stylesheet jar:file:/usr/share/ant/lib/ant-junit.jar!/org/apache/tools/ant/taskdefs/optional/junit/xsl/junit-noframes.xsl
[junitreport] Warning:  org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser: Property 'http://javax.xml.XMLConstants/property/accessExternalDTD' is not recognized.
[junitreport] Warning:  org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser: Property 'http://www.oracle.com/xml/jaxp/properties/entityExpansionLimit' is not recognized.

BUILD FAILED
/var/lib/jenkins/workspace/mytest/build.xml:357: java.lang.StackOverflowError
    at com.sun.org.apache.xml.internal.serializer.ToHTMLStream$Trie.get2(ToHTMLStream.java:2291)
    at com.sun.org.apache.xml.internal.serializer.ToHTMLStream.getElemDesc2(ToHTMLStream.java:633)
    at com.sun.org.apache.xml.internal.serializer.ToHTMLStream.startElement(ToHTMLStream.java:795)
    at com.sun.org.apache.xml.internal.serializer.ToStream.startElement(ToStream.java:1853)
    at junit_noframes.br$dash$replace()
    at junit_noframes.br$dash$replace()
    at junit_noframes.br$dash$replace()
    at junit_noframes.br$dash$replace()
    at junit_noframes.br$dash$replace()
    at junit_noframes.br$dash$replace()

1 个答案:

答案 0 :(得分:2)

显然这是一个已知的bug与蚂蚁,并在1.9.4中修复。将ant升级到1.9.7。为我解决了这个问题!