jakarta-cactus-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ryan Olson <...@financialcontent.com>
Subject Re: [Resolved] Baffled by classpath problem
Date Wed, 04 Dec 2002 18:37:27 GMT
Tim,

Thanks very much for your helpful information. I hadn't realized that there's 
a hierarchy involved in what various classes can "see" within the JVM.

Ryan Olson

On Wednesday 04 December 2002 7:25 am, Tim Taylor wrote:
> The reason you were seeing a java.lang.NoClassDefFoundError when the
> cactus.jar file is in your jre/lib/ext directory is because the classes
> in the cactus.jar file can't "see" the servlet related classes
> javax.servlet.http.HttpServlet or any of your test classes.  The reason
> the servlet and test classes can't be seen in this configuration is
> because the JVM uses a series of different ClassLoaders arranged in a
> hierarchical fashion that looks more or less like this:
>
> 1: Bootstrap class loader
> 2: Standard Extensions class loader
> 3: Class loader for entries in the CLASSPATH environment variable
> 4: Application specific class loaders
> ...
>
> Classes can only "see" other classes that are loaded by the same class
> loader as they are, or a classloader higher in the hierarchy.  In your
> case, the Cactus files are at level 2, and the
> javax.servlet.http.HttpServlet class is at level 4 or lower, depending
> on the Web container you are using.  Classes loaded by a level 2 class
> loader can only load classes that "live" at level 2 or level 1.
>
> Hope this helps.
> - Tim Taylor
>

--
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