jakarta-cactus-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Cory Lum" <lum.c...@gmail.com>
Subject Unable to run cactus test with ant and cactus
Date Mon, 24 Nov 2008 16:16:24 GMT
Ant 1.7.1
Cactus 1.8
Tomcat 5.5
I'm trying to automate a test with ant and cactus but having some
classloader issues.

Here is part of my buildfile:
<!-- Libraries required for the Cactus tests -->
<property name="aspectjrt.jar"
location="${cactus.jars}/aspectjrt-1.5.3.jar"/>
<property name="cactus.core.jar"
location="${cactus.jars}/cactus.core.framework.uberjar.javaEE.14-1.8.0.jar"/>
<property name="cactus.ant.jar"
location="${cactus.jars}/cactus.integration.ant-1.8.0.jar"/>
<property name="cactus.shared.jar"
location="${cactus.jars}/cactus.integration.shared.api-1.8.0.jar"/>
<property name="commons.httpclient.jar"
location="${cactus.jars}/commons-httpclient-3.1.jar"/>
<property name="commons.logging.jar"
location="${cactus.jars}/commons-logging-1.1.jar"/>
<property name="httpunit.jar" location="${cactus.jars}/httpunit-1.6.jar"/>
<property name="junit.jar" location="${cactus.jars}/junit-3.8.2.jar"/>
<property name="cargo.ant.jar" location="${cactus.jars}/cargo-ant-0.9.jar"/>
<property name="cargo.core.jar"
location="${cactus.jars}/cargo-core-uberjar-0.9.jar"/>
<property name="nekohtml.jar" location="${cactus.jars}/nekohtml-1.9.6.jar"/>
<path id="cactus.myclasspath">
<pathelement location="${aspectjrt.jar}"/>
<pathelement location="${cactus.core.jar}"/>
<pathelement location="${cactus.ant.jar}"/>
<pathelement location="${cactus.shared.jar}"/>
<pathelement location="${commons.httpclient.jar}"/>
<pathelement location="${commons.logging.jar}"/>
<pathelement location="${junit.jar}"/>
<pathelement location="${httpunit.jar}"/>
<pathelement location="${nekohtml.jar}"/>
<pathelement location="${cargo.ant.jar}"/>
<pathelement location="${cargo.core.jar}"/>
</path>
<cactifywar destfile="myapp.war" srcfile="C:/originalWebApp/mainapp.war">
</cactifywar>
<cactus haltonfailure="no" showoutput="yes" printsummary="on"
warfile="myapp.war">
 <classpath>
  <pathelement location="${unittest.testsrc}"/>
  <pathelement location="${cactus.myclasspath}"/>
 </classpath>
 <containerset>
  <cargo containerId="tomcat5x" home="${tomcat5x.home}"
output="./tomcat.cactus.log">
   <configuration home="./tomcat_cactus">
     <property name="cargo.servlet.port" value="8080"/>
     <property name="cargo.logging" value="high"/>
     <deployable type="war" file="myapp.war"/>
   </configuration>
  </cargo>
 </containerset>
 <formatter type="xml"/>
 <batchtest fork="yes" todir="./reports">
   <fileset dir="${unittest.testsrc}">
  <include name="**/ServicesTestSuite.java"/>
   </fileset>
 </batchtest>
</cactus>


After running this, my report contains
<error message="org/apache/cactus/ServletTestSuite"
type="java.lang.NoClassDefFoundError">java.lang.NoClassDefFoundError:
org/apache/cactus/ServletTestSuite
 at java.lang.ClassLoader.defineClass1(Native Method)
 at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
 at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
 at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
 at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
 at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
 at java.security.AccessController.doPrivileged(Native Method)
 at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
 at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
 at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268)
 at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
 at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
 at java.lang.Class.forName0(Native Method)
 at java.lang.Class.forName(Class.java:164)
</error>


I tried adding cactus.myclasspath to <classpath> and it still does not work.
I tried reading the archives which talked about client classpath and server
classpath and I could not resolve the issue. Please help.

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message