Skip to content

Tomcat Classloader hierarchy, a quick review

Taken from Tomcat’s reference page. Tomcat’s classloader hiararchy looks something like this:

                              Bootstrap
                                  |
                               System
                                  |
                               Common
                              /      \
                         Catalina   Shared
                                     /   \
                                Webapp1  Webapp2 .. etc

Classloader rules:

* Classloaders will only load the “same” class once.
* Two classes are only the “same” if they have the same name, and were loaded by the same classloader.
* When your webapp references a class, if it’s not already loaded, the search order goes:
yourWebapp –> Shared –> Common –> System –> Bootstrap

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]

Post a Comment

Your email is never published nor shared. Required fields are marked *
*
*