struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sri Sankaran" <Sri.Sanka...@sas.com>
Subject RE: Classloader behavior in Struts 1.0.2 and Tomcat 4.1.12
Date Tue, 03 Dec 2002 14:56:16 GMT
Ah! The wonderful world of ClassLoaders!  

What you are seeing is expected behavior.  The manual at http://jakarta.apache.org/tomcat/tomcat-4.1-doc/class-loader-howto.html
should explain it all.

Sri

> -----Original Message-----
> From: Jim Coble [mailto:Jim.Coble@duke.edu] 
> Sent: Tuesday, December 03, 2002 9:27 AM
> To: struts-user@jakarta.apache.org
> Subject: Classloader behavior in Struts 1.0.2 and Tomcat 4.1.12
> 
> 
> I've just seen some surprising behavior in finding Action 
> classes depending on where I put the struts.jar file and 
> where I put the action class.  Has anyone else seen this?  Is 
> this how one would expect it to work?  I'm using Struts 1.0.2 
> and Tomcat 4.1.12 on a Solaris 8 Sun server.
> 
> If I put struts.jar in $CATALINA_HOME/common/lib and the 
> action class for a particular mapping in 
> $CATALINA_HOME/common/classes/..., all works well.
> 
> Likewise, all works well if I put struts.jar in 
> $CATALINA_HOME/webapps/MyApp/WEB-INF/lib and the action class 
> in $CATALINA_HOME/webapps/MyApp/WEB-INF/classes/...
> 
> However, if I put struts.jar in 
> $CATALINA_HOME/webapps/MyApp/WEB-INF/lib
> and the action class in $CATALINA_HOME/common/classes/..., I 
> get a "class not found" error for class 
> "org/apache/struts/action/Action" when it tries to 
> instantiate my action class.
> 
> And, if I put struts.jar in $CATALINA_HOME/common/lib and my 
> action class in 
> $CATALINA_HOME/webapps/MyApp/WEB-INF/classes/..., I get a 
> "class not found" error for my action class when it tries to 
> instantiate the mapping.
> 
> Obviously, the work-around is to put both pieces in one place 
> or the other but I don't understand why that should be the 
> case, assuming I get the package names right, etc.
> 
> I'm guessing that this has something to do with the way in 
> which Tomcat 4.1.12 handles class loading but, if anyone 
> could shed light on this, I would much appreciate it.
> 
> Thanks in advance.
> --Jim
> 
> ==================================
> Jim Coble
> Senior Technology Specialist
> Center for Instructional Technology
> Email: jim.coble@duke.edu
> Voice: 919-660-5974  Fax: 919-660-5923
> Box 90198, Duke University
> Durham, NC 27708-0198
> ==================================
> 
> 
> 
> 
> --
> To unsubscribe, e-mail:   
> <mailto:struts-user-> unsubscribe@jakarta.apache.org>
> For 
> additional commands, 
> e-mail: <mailto:struts-user-help@jakarta.apache.org>
> 
> 

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


Mime
View raw message