4.4. ClassLoaders in Geronimo

Each configuration (server, application module, or resource) has its own ClassLoader. The hierarchy of ClassLoaders matches the hierarchy of configurations. So if a Web Application module has an EJB JAR as its parent, then the ClassLoader for the EJB JAR will be the parent of the ClassLoader for the Web Application. Clearly the ClassLoader arrangement is one of the key reasons to configure the module dependencies in Geronimo.

Within an application EAR, EJBs and RARs are loaded in one ClassLoader, while Web Applications are loaded in a child of that ClassLoader. The ClassLoader hierarchy for an EAR including one module of each type and using a database would look like Figure 4.3, “EAR ClassLoader Hierarchy”.

Figure 4.3. EAR ClassLoader Hierarchy

EAR ClassLoader Hierarchy

Notes on Figure 4.3, “EAR ClassLoader Hierarchy”: