Order of loading jar files from lib directory e.g Tomcat

It's all described in Tomcat's ClassLoading HOW-TO, which is similar for Tomcat different version. Summarized, the loading order is as follows:
  1. bootstrap/system (JRE/lib, then server.loader)
  2. webapp libraries (WEB-INF/classes, then WEB-INF/lib)
  3. common libraries (common.loader, then Tomcat/lib)
  4. webapp-shared libraries (shared.loader)
One point NOT documented, NOT specified is when it comes to loading a JAR from respective classloader it follows:

   - For tomcat 5-7 the order is alphabetical. It uses sort.
   - For tomcat 8 is random decided by underlying file system.  Issue tracker is discussed. 

      

No comments :

Post a Comment