jakarta-cactus-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kim Thrys√łe ...@netnord.dk>
Subject Cactus Tests and WebApp seem to use different class loaders
Date Fri, 11 Jan 2002 12:28:19 GMT
When I recently changed to tomcat4 my Cactus tests seem to work on 
different classes (different class loader) than the web application, 
which suggests that I have something wrong in my Cactus 
configuration(?). The result of course is that my testcases work on an 
uninitialized instance of the application that I am testing.

My cactus version is 1.2, jdk is 1.3.1, tomcat is 4.0.1.

I can see that at least one other person has had trouble with a 
ServletRedirector been configured to the wrong context, so I suspect 
that this has something to do with my problem. However, the 
ServletRedirector runs in the same context as the rest of the webapp.

The webapp (a single Filter) is configured to use the default context 
and sits in "/". This Filter is configured to keep its hands from 
"/ServletRedirector/*", which it also does -- i.e. the tests *are* 
executed.

The cactus.properties file contains simply
cactus.servletRedirectorURL = http://localhost:80/ServletRedirector/

The web.xml has the two servlets mounted as follows
 <!-- *****************
       * Root Servlets *
       ***************** -->
  <filter>
    <filter-name>rootFilter</filter-name>
    <filter-class>dk.netnord.cmd.servlet.RootFilter</filter-class>
  </filter>
  <filter-mapping>
    <filter-name>rootFilter</filter-name>
    <url-pattern>/*</url-pattern>
  </filter-mapping>

  <!-- *****************************
       * Serverside unit testing servlets *
       ***************************** -->
    <servlet>
        <servlet-name>ServletRedirector</servlet-name>
        
<servlet-class>org.apache.cactus.server.ServletTestRedirector</servlet-class>
    </servlet>
    <servlet-mapping>
        <servlet-name>ServletRedirector</servlet-name>
        <url-pattern>/ServletRedirector/</url-pattern>
    </servlet-mapping>

Does anyone have experiences in this direction or can anyone explain why 
the test Classes use a different ClassLoader?

Cheers

-- 
Kim Thrysoe - Netnord A/S - http://www.netnord.dk



--
To unsubscribe, e-mail:   <mailto:cactus-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:cactus-user-help@jakarta.apache.org>


Mime
View raw message