jakarta-cactus-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Justin Thomas <Justin.Tho...@RCP.co.uk>
Subject context classloader and webapp classloader....
Date Mon, 12 May 2003 14:06:54 GMT
Hi, 
I am trying to get cactus to work with Tomcat 4.1.18 however when I run my
tests I get this error.  I cannot see how the error finding class is
happening I have expanded my war file and it is there.  I have also copied
all of the cactus files into my WEB-INF lib directory.  I am finding this so
annoying and I can't seem to find any help on it.  Can someone please help
me sort this out?

Although they are not called cactus.jar but cactus.1.4.jar because of
versioning but I am sure that isn't a problem.  Here is my ANT build for
that

  <target name="distTestWar" depends="prepare-dist">

        <!-- Create the war file -->
        <war warfile="${dist.dir}/${test.warfile.name}"
             webxml="${web.dir}/WEB-INF/web.xml">
             
            <classes dir="${build.dir}${web.classes}"/>

            <!-- log_server.properties need to be in the server classpath
-->
            <classes dir="${conf.dir}/test">
                <include name="log_server.properties"/>
                <include name="log4j.properties"/>
                <include name="cactus.properties"/>
            </classes>

	<!-- We need to copy all dependent jar in the war. This is because
if we just put these jars in the global classpath for the Servlet engine,
the Cactus jar 	might not be able to load the test case class as it may be
loadable only by the war classloader -->
	<lib dir="${build.dir}/WEB-INF/lib/"/> 
            <fileset dir="${web.dir}" excludes="**/WEB-INF/web.xml"/>
        </war>
    </target>

The error is this:

 [junit] Testcase:
testGetValueAttribute(org.wwww.dateConversion.test.RequestUtilTest):
Caused an ERROR
    [junit] Error finding class
[org.wwww.dateConversion.test.RequestUtilTest] using both the Context
classloader and the webapp classloader. Possible causes include:
    [junit]     - Your webapp does not include your test classes,
    [junit]     - The cactus.jar is not located in your WEB-INF/lib
directory and your Container has not set the Context classloader to point to
the webapp one
    [junit] javax.servlet.ServletException: Error finding class
[org.wwww.dateConversion.test.RequestUtilTest] using both the Context
classloader and the webapp classloader. Possible causes include:
    [junit]     - Your webapp does not include your test classes,
    [junit]     - The cactus.jar is not located in your WEB-INF/lib
directory and your Container has not set the Context classloader to point to
the webapp one
    [junit]     at
org.apache.cactus.server.AbstractWebTestCaller.getTestClassClass(AbstractWeb
TestCaller.java:344)
    [junit]     at
org.apache.cactus.server.AbstractWebTestCaller.getTestClassInstance(Abstract
WebTestCaller.java:301)
    [junit]     at
org.apache.cactus.server.AbstractWebTestCaller.doTest(AbstractWebTestCaller.
java:143)
    [junit]     at
org.apache.cactus.server.AbstractWebTestController.dispatch87_handleRequest(
AbstractWebTestController.java;org/apache/cactus/util/log/LogAspect.aj(1k):1
25)
    [junit]     at
org.apache.cactus.server.AbstractWebTestController.around87_handleRequest(Ab
stractWebTestController.java;org/apache/cactus/util/log/LogAspect.aj(1k):114
9)
    [junit]     at
org.apache.cactus.server.AbstractWebTestController.handleRequest(AbstractWeb
TestController.java;org/apache/cactus/util/log/LogAspect.aj(1k):101)
    [junit]     at
org.apache.cactus.server.ServletTestRedirector.dispatch113_doPost(ServletTes
tRedirector.java;org/apache/cactus/util/log/LogAspect.aj(1k):123)
    [junit]     at
org.apache.cactus.server.ServletTestRedirector.around113_doPost(ServletTestR
edirector.java;org/apache/cactus/util/log/LogAspect.aj(1k):1149)
    [junit]     at
org.apache.cactus.server.ServletTestRedirector.doPost(ServletTestRedirector.
java;org/apache/cactus/util/log/LogAspect.aj(1k):109)
    [junit]     at
org.apache.cactus.server.ServletTestRedirector.dispatch112_doGet(ServletTest
Redirector.java;org/apache/cactus/util/log/LogAspect.aj(1k):96)
    [junit]     at
org.apache.cactus.server.ServletTestRedirector.around112_doGet(ServletTestRe
director.java;org/apache/cactus/util/log/LogAspect.aj(1k):1149)
    [junit]     at
org.apache.cactus.server.ServletTestRedirector.doGet(ServletTestRedirector.j
ava;org/apache/cactus/util/log/LogAspect.aj(1k):92)
    [junit]     at
javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
    [junit]     at
javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    [junit]     at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
FilterChain.java:247)
    [junit]     at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
ain.java:193)
    [junit]     at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja
va:260)
    [junit]     at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:643)
    [junit]     at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
    [junit]     at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
    [junit]     at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja
va:191)
    [junit]     at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:643)
    [junit]     at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
    [junit]     at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
    [junit]     at
org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2415)
    [junit]     at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180
)
    [junit]     at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:643)
    [junit]     at
org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.
java:170)
    [junit]     at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:641)
    [junit]     at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172
)
    [junit]     at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:641)
    [junit]     at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
    [junit]     at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
    [junit]     at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java
:174)
    [junit]     at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java:643)
    [junit]     at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
    [junit]     at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
    [junit]     at
org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
    [junit]     at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:432)
    [junit]     at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConne
ction(Http11Protocol.java:386)
    [junit]     at
org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:534)
    [junit]     at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.jav
a:530)
    [junit]     at java.lang.Thread.run(Thread.java:536)

__________________________________________________
Justin Thomas BSc (Hons)
Software Engineer
RCP Consultants Ltd
<http://www.rcp.co.uk/>

AIM: RCPAnimal
Tel: 01235 510116
Direct: 01235 514526

"Never make anything simple and efficient when a way can be found to make it
complex and wonderful."

This e-mail and any files transmitted with it are strictly confidential and
intended only for use by the addressee unless otherwise indicated.  If you
are not the intended recipient any use, dissemination printing or copying is
strictly prohibited.

If you have received this e-mail in error, please notify us immediately.


Mime
View raw message