ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Colin Smith" <csm...@conversagent.com>
Subject linux junittask java.lang.NoClassDefFoundError
Date Fri, 20 Apr 2001 18:51:53 GMT
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.SAXParserFac
toryImpl -classpath
/home/colin/cvs/server/build/classes:/home/colin/cvs/server/build/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/httpunit.jar:/ho
me/colin/cvs/server/lib/jaxp.jar:/home/colin/cvs/server/lib/jdom.jar:/ho
me/colin/cvs/server/lib/jmxri.jar:/home/colin/cvs/server/lib/jmxtools.ja
r:/home/colin/cvs/server/lib/jnp-client.jar:/home/colin/cvs/server/lib/j
npserver.jar:/home/colin/cvs/server/lib/jndi.jar:/home/colin/cvs/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/colin/cvs/ser
ver:/home/colin/cvs/server/bin/lib/ant.jar:/home/colin/cvs/server/bin/li
b/JakartaOroMatcher.jar:/home/colin/cvs/server/bin/lib/jaxp.jar:/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.PlainJUnitResultF
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

Mime
View raw message