Difficult to see what's going on since from what we can see everything it is
there to run the tests (ie optional.jar / ant.jar / junit.jar)
try adding the following formatter:
<formatter type="plain" usefile="no"/>
With luck you might get additional information that is not flushed to the
file.
Otherwise try executing the same command line directly.
Cheers,
--
Stéphane Bailliez
Software Engineer, Paris - France
iMediation - http://www.imediation.com
Disclaimer: All the opinions expressed above are mine and not those from my
company.
> -----Original Message-----
> From: Colin Smith [mailto:[EMAIL PROTECTED]]
> Sent: Friday, April 20, 2001 8:52 PM
> To: [EMAIL PROTECTED]
> Subject: linux junittask java.lang.NoClassDefFoundError
>
>
> Hi.
>
> I've noticed that I am unable to run junit tasks (via
> forking) using the
> HotSpot VM on Linux (redhat 7.0 w/ sun 1.2.2/1.3, ibm 1.3 or blackdown
> 1.2.2/1.3 jvms). It works if it is run within the ant jvm,
> but this is
> not ideal because ant's environment and classpath must contain the
> superset of all of the test envs/classpaths. It works fine on win32
> w/sun or ibm jvms.
>
> The task appears to be executed properly, but the newly spawned
> java.lang.NoClassDefError exception gets thrown with no stacktrace or
> intended class to be loaded, and no results get written to the
> testresults directory.
>
> I have debugged this and found that the forked hotspot jvm is invoked
> almost exactly the same as with the classic vm (no -classic in cmd
> args).
>
> Any ideas?
>
> Thanks huge in advance,
>
> Colin.
>
> the task is defined as the following in build.xml
>
> <junit fork="yes" printsummary="yes" haltonfailure="yes">
>
> <jvmarg value="${unitvm}"/>
> <jvmarg value="${unittests.props.always}"/>
> <classpath>
> <pathelement location="${build.classes.dir}" />
> <pathelement location="${build.genclasses.dir}" />
> <pathelement location="${build.addtounitcp.dir}" />
> <path refid="project.classpath"/>
> </classpath>
>
> <formatter type="plain" />
>
> <!-- if adding on, don't forget there is also the batchtest
> element! -->
>
> <test name="${testname}"
> haltonfailure="yes"
> outfile="${build.testresults.dir}/${testname}" >
> </test>
> </junit>
>
> this outputs the following for build.sh test.unit.log
>
> ...
> test.unit.log:
> [junit] Calling: exec
> /usr/local/jdk1.3/bin/i386/native_threads/java
> -Djavax.xml.parsers.SAXParserFactory=org.apache.xerces.jaxp.SA
> XParserFac
> toryImpl -classpath
> /home/colin/cvs/server/build/classes:/home/colin/cvs/server/bu
> ild/gencla
> sses:/home/colin/cvs/server/build/addtounitcp:/home/colin/cvs/
> server/lib
> /avalonapi.jar:/home/colin/cvs/server/lib/castor-xml.jar:/home
> /colin/cvs
> /server/lib/DLConcurrent.jar:/home/colin/cvs/server/lib/httpun
> it.jar:/ho
> me/colin/cvs/server/lib/jaxp.jar:/home/colin/cvs/server/lib/jd
> om.jar:/ho
> me/colin/cvs/server/lib/jmxri.jar:/home/colin/cvs/server/lib/j
> mxtools.ja
> r:/home/colin/cvs/server/lib/jnp-client.jar:/home/colin/cvs/se
> rver/lib/j
> npserver.jar:/home/colin/cvs/server/lib/jndi.jar:/home/colin/c
> vs/server/
> lib/junit.jar:/home/colin/cvs/server/lib/log4j.jar:/home/colin
> /cvs/serve
> r/lib/Tidy.jar:/home/colin/cvs/server/lib/xerces.jar:/home/col
> in/cvs/ser
> ver:/home/colin/cvs/server/bin/lib/ant.jar:/home/colin/cvs/ser
> ver/bin/li
> b/JakartaOroMatcher.jar:/home/colin/cvs/server/bin/lib/jaxp.ja
> r:/home/co
> lin/cvs/server/bin/lib/optional.jar:/home/colin/cvs/server/bin
> /lib/parse
> r.jar:/usr/local/jdk1.3/lib/tools.jar
> org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner
> server.appsets.deployment.AppSeDeploymentManagerLogTest
> haltOnError=false haltOnFailure=true
> formatter=org.apache.tools.ant.taskdefs.optional.junit.PlainJU
> nitResultF
> ormatter,/home/colin/cvs/server/build/testresults/TEST-server.
> appsets.de
> ployment.AppSeDeploymentManagerLogTest.txt
> [junit] Exception in thread "main"
> java.lang.NoClassDefFoundError:
> BUILD FAILED
>
> /home/colin/cvs/server/proj/build.xml:919: Test
> server.appsets.deployment.AppSeDeploymentManagerLogTest failed
>
> Total time: 9 seconds
>