Reputation: 35
How does Tomcat (or any Web application server) manage to load the different WAR files separately, though it works in one JVM process? They may have the same classes and other resources, but it has to guarantee consistency and isolation of applications.
Upvotes: 2
Views: 1457
Reputation: 10433
Tomcat creates (Web) application class loaders for each deployed WAR. It has some common class loaders. The overall hierachy is best described in the class loader howto:
http://tomcat.apache.org/tomcat-7.0-doc/class-loader-howto.html
BTW: Tomcat does an incredible amount of resource management in order to allow applications to be undeployed. This is described here:
http://wiki.apache.org/tomcat/MemoryLeakProtection
and ties tightly into class loaders and class unloading.
Upvotes: 7