Tomcat: Class loaders mechanism
Tomcat creates the class-loaders with the parent-child hierarchy as shown in the diagram. The class loading is fairly intuitive. However a pragmatic developer needs to understand it properly to avoid problem with class instantiation since it differs a bit from the typical Java class loading mechanism.
Tomcat: Accessing web app classes from shared libraries
It is not a recommended practise to have libraries placed in Tomcat’s lib directory to access classes in a web application. However, there are cases when you may want to flout this practise. Tomcat’s class loading mechanism will not allow you to do so since the web classes and the lib classes are loaded by different class loaders. The workaround in such a case is to use a custom bootstrap loader. This loader should be used to load all the application specific classes.