Rob Shaw wrote:
> For those that may be interested...
>
> I was unclear as to how Tomcat was resolving class
> loading and the visibility of classes to a context's
> classloader so I created a simlpe test suite.
> The test results are attached.
>
Rob,
Thanks for doing the chart. I would also point out that all of the results you
identified mean that Tomcat is operating correctly according to the servlet spec.
If you are puzzled about what classes can load from where, there is a very simple
principle to keep in mind: classes can load other classes from the same classloader
they themselves were loaded from, or from a classloader *above* that classloader in
the hierarchy. Classes cannot load from a classloader *below* their own loader in the
hierarchy.
For Tomcat 3.0 - 3.2, the classloader hierarchy is very simple:
System Classloader (shared)
|
Webapp Classloader (one per webapp)
So, as your results demonstrate, classes that were found on the system classloader
cannot load classes found in the webapp classloader. This was the cause of all the
"No" results in your tests.
(For Tomcat 4.0 the hierarchy has more layers, but the same principle applies).
>
> Rob Shaw
> Servidium Inc.
>
Craig McClanahan