jakarta-cactus-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bennett, Jeffrey" <JJBenn...@OneCommunications.com>
Subject Cactus 1.8 with Tomcat 7
Date Mon, 13 Sep 2010 19:57:51 GMT

I have been successfully using Cactus 1.8 with a Tomcat 5.5 installation
for some time and am in the process of upgrading to Tomcat 7.0.2.  I'm
having trouble getting it to work.   Tomcat 7.x launches fine from the
command line, so I know I have all the jars that I need in the right
place, etc.  However, when launched as part of a <cactus> from ant, it
fails.  I'm wondering if the <cactus> doesn't support Tomcat 7, or if
there's something subtle that I'm missing.

The normal reason for this NoClassDefFoundError is missing bootstrap.jar
or tomcat-juli.jar.  But like I said, it launches OK from command line
so I know they are present.  I think I'm making them visible via the
<classpath> (see below), but I'm stumped.

Any help appreciated!
Jeff Bennett

====================================================

The error I get is this:
   [cactus]
-----------------------------------------------------------------
   [cactus] Running tests against Tomcat 5.x @ http://localhost:8080
   [cactus]
-----------------------------------------------------------------
   [cactus] Starting up container
   [cactus] Deploying
[C:\EclipseWorkspace\courier_ping\dist\courier_ping-cactus.war] to
[c:\apache-tomcat-7.0.2/webapps]...
   [cactus] Tomcat 5.x starting...
   [cactus] java.lang.NoClassDefFoundError:
org/apache/juli/logging/LogFactory
   [cactus]     at
org.apache.catalina.startup.Bootstrap.<clinit>(Bootstrap.java:55)
   [cactus] Caused by: java.lang.ClassNotFoundException:
org.apache.juli.logging.LogFactory
   [cactus]     at
java.net.URLClassLoader$1.run(URLClassLoader.java:202)
   [cactus]     at java.security.AccessController.doPrivileged(Native
Method)
   [cactus]     at
java.net.URLClassLoader.findClass(URLClassLoader.java:190)
   [cactus]     at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
   [cactus]     at
sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
   [cactus]     at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
   [cactus]     ... 1 more
   [cactus] Could not find the main class:
org.apache.catalina.startup.Bootstrap.  Program will exit.
   [cactus] Exception in thread "main"
   [cactus] Java Result: 1
   [cactus] Exception in thread "Thread-6"
org.codehaus.cargo.container.ContainerException: Failed to start the
Tomcat 5.x container.

===================================================
My ant target looks like this:

		<cactus printsummary="yes" 
				warfile="${war.cactus.name}.war" 
				fork="yes" 
				dir="${env.TOMCAT_HOME}/logs" 
				haltonerror="no" 
				jvm="${jreHome}/bin/java"
				haltonfailure="no" 
				showoutput="yes" 
				failureproperty="testsfailed.cactus"
filtertrace="false">
			<sysproperty key="log4j.configuration"
value="file:${log4jconfig.path}" />
			<sysproperty
key="net.sourceforge.cobertura.datafile"
	                    file="${cobertura.file}" />

			<classpath>
				<pathelement
location="${env.TOMCAT_HOME}/bin/bootstrap.jar" />
				<pathelement
location="${env.TOMCAT_HOME}/bin/tomcat-juli.jar" />
				<pathelement
path="${build.test.cactus.classes.dir}" />
				<pathelement path="${build.classes.dir}"
/>
				<pathelement
path="${build.src.classes.dir}" />
				<path refid="build.classpath" />
			</classpath>
			<formatter type="xml" usefile="true"/>

			<containerset>
				<cargo containerId="tomcat5x"
home="${env.TOMCAT_HOME}"  
				      action="start">

					<configuration type="existing"
home="${env.TOMCAT_HOME}">
						<property
name="cargo.servlet.port" value="8080"/>
						<property
name="cargo.logging" value="high"/>
						<property
name="cargo.jvmargs" value="${cactusJVMArgs}"/>
						<property
name="cactus.toDir" value="${build.test.cactus.dir}/test-results"/>
						<deployable type="war"
file="${war.cactus.name}.war"/>
					</configuration>
				</cargo>

			</containerset>


			<batchtest
todir="${build.test.cactus.dir}/test-results">
				<fileset dir="test/cactus">
					<include
name="${cactus.include}" />
					<exclude
name="**/*TestCase*.java"/>
					<size value="0" when="more"/>
				</fileset>
			</batchtest>

		</cactus>

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