ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeremy Mawson <>
Subject Optional Task JUnit - unable to instantiate DocumentBuilderFactor yImpl since upgrading to 1.5.1
Date Fri, 08 Nov 2002 11:23:42 GMT

I have been successfully using the Ant optional junit task in my builds for
some time now. Recently we upgraded Ant to version 1.5.1 and suddenly junit
is no longer able to provide XML formatted test results. I've spent around 6
hours RTM'ing, STW'ing, sourcecode-reading and head-scratching to no avail,
so I've come here for help.

The Ant logging indicates that the junit task wishes to instantiate a
com.sun.xml.parser.DocumentBuilderFactoryImpl, but is unable to do so. AFAIK
this particular class exists in parser.jar, which is neither distributed
with Ant nor recommended in the Library Dependencies section of the Ant

Notably another implementation
(org.apache.xerces.jaxp.DocumentBuilderFactoryImpl) is distributed in
xercesImpl.jar. I read on the JUnit site that you can force the use of a
different implementation by creating/modifying under the
JRE's lib dir. However when I set the property
javax.xml.parsers.DocumentBuilderFactory to
org.apache.xerces.jaxp.DocumentBuilderFactoryImpl Ant failed to execute at

Is the xercesImpl version of the DocumentBuilderFactoryImpl the one I will
eventually require? 
If so, how can I enable Ant to find this version?

The exact error seen is:

    [junit] javax.xml.parsers.FactoryConfigurationError:
    [junit] 	at
    [junit] 	at
    [junit] 	at
    [junit] 	at
    [junit] 	at
    [junit] 	at
    [junit] Exception in thread "main" 
    [junit] TEST FAILED

I hope someone can help shed some light on this for me. Thanks for reading
this far. :) 

Jeremy Mawson

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message