Cannot run unit tests from Ant 1.7.0 (Sun) Java 1.3.1
-----------------------------------------------------

                 Key: FILEUPLOAD-153
                 URL: https://issues.apache.org/jira/browse/FILEUPLOAD-153
             Project: Commons FileUpload
          Issue Type: Bug
    Affects Versions: 1.2.1
         Environment: java version "1.3.1_15"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.1_15-b01)
Java HotSpot(TM) Client VM (build 1.3.1_15-b01, mixed mode)

Windows XP 5.1 Service Pack 2 x86-32
            Reporter: Gary Gregory
            Priority: Minor
             Fix For: 1.2.1


Cannot run unit tests from Ant 1.7.0 (Sun) Java 1.3.1.

> From: Jörg Schaible [mailto:[EMAIL PROTECTED]
> Sent: Thursday, January 10, 2008 10:56 PM
> To: Jakarta Commons Developers List
> Subject: RE: [VOTE] Release commons-fileupload 1.2.1 (rc3)
> 
> Hi Gary,
> 
> Gary Gregory wrote:
> > Hello:
> >
> > The ant build in this RC fails on Sun Java 1.3.1 [1] because
> > the unit tests use the XML formatter which depend on W3C
> > code. The W3C code is in Java 1.4 but not 1.3. The ant build
> > also reports, apparently non-fatal errors [1] when attempting
> > to fetch non-existent files out of the maven repos.
> >
> > Personally, I no longer care about 1.3.1 but I thought you might like
> > to know.
> 
> This can be fixed by adding Xalan 2.7.0 to Ant's lib, but you have to use the 
> one
> from Apache's Maven repo, not the one from their distribution. Se
> http://jira.codehaus.org/browse/HAUS-1572

That does not work for me, no matter what version of Xalan I put in 
ANT_HOME/lib, I always get:
{noformat} 
Using loader null on class 
org.apache.tools.ant.taskdefs.optional.junit.XMLJUnitResultFormatter: 
java.lang.NoClassDefFoundError: org/w3c/dom/Node
        at 
org.apache.tools.ant.taskdefs.optional.junit.FormatterElement.createFormatter(FormatterElement.java:241)
        at 
org.apache.tools.ant.taskdefs.optional.junit.FormatterElement.createFormatter(FormatterElement.java:214)
        at 
org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.transferFormatters(JUnitTestRunner.java:818)
        at 
org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.launch(JUnitTestRunner.java:910)
        at 
org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(JUnitTestRunner.java:766)
--- Nested Exception ---
java.lang.NoClassDefFoundError: org/w3c/dom/Node
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:115)
        at 
org.apache.tools.ant.taskdefs.optional.junit.FormatterElement.createFormatter(FormatterElement.java:232)
        at 
org.apache.tools.ant.taskdefs.optional.junit.FormatterElement.createFormatter(FormatterElement.java:214)
        at 
org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.transferFormatters(JUnitTestRunner.java:818)
        at 
org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.launch(JUnitTestRunner.java:910)
        at 
org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(JUnitTestRunner.java:766)
{noformat} 
Then I read:

http://ant.apache.org/faq.html#junit-no-runtime-xml

This states that the only way to fix this is to fix one's build.xml file like 
so:
"the easiest solution is to add
{code:xml}
<pathelement 
path="${ant.home}/lib/xml-apis.jar:${ant.home}/lib/xercesImpl.jar"/>
{code}
to your task's <classpath>."
I implemented this and the build succeeded. So I am submitting the attached 
patch to build.xml. This path element is ignored by Java versions >= 1.4 since 
one must use the override mechanism to use different XML libs than what is in 
the runtime.

Thank you,
Gary


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to