The Tomcat Class Loader HOW-TO documentation describes 4 different class loaders:
- Bootstrap
- System
- Common
- Webapp
In the default catalina.properties file, however, there are properties defined for a shared and server class loader as well. In the default version of the file both of these properties are empty and the comments say:
If left as blank, the “common” loader
will be used as Catalina’s
“shared”/”server” loader.
I have not been able to find any additional documentation about these class loaders. My question is, in which order are the shared and system loaders searched relative to the common loader? And additionally, what is the intended use for these class loaders?
I recently ran into this issue as well and here is what I found, (This is all from Tomcat 7 trunk)
Here is the relevant source,
So if nothing is defined, they fallback to using the common.loader entries.
As to the order that they are loaded in,
here is the source for loading them in, from source
Line 229 sets the common.loader classLoader, then line 251 sets the shared.loader classloader is set as Catalinas parent class loader.