Class Loader and Java /J2EE Application Packaging

Just a step forward to discuss about java and j2EE class loader and Java/J2EE application packaging. Mainly on the complex J2EE application packaging.

Thursday, December 14, 2006

Class Loading in J2EE

Although the J2EE specification does not define a fixed classloader structure but some of the specifications impacts the class loading process significantly. The specifications that affects the class loading process are
  • Applications are component-based, co-resident but separate, and reloadable.
  • Ability of Servlets and JSPs to call EJBs, and for all three to be able to use resource adapters.
  • Web-modules within an application are required to be isolated from one another.
  • With EJB 2.x local interfaces add the requirement that implementation classes should also be visible.
J2EE application servers must arrange the classloaders hierarchy to make sure that each module has the correct visibility to meet the above J2EE specifications. Below diagram shows a typical classloader hierarchy structure for a typical J2EE Application server for loading an EAR file containing multiple web modules, EJBs and resource-adapters.

The above diagram shows a typical classloader hierarchy of J2EE application server, but there is no guarantee that the same hierarchy will be available in all application server. The alternate hierarchy may be as given below in the diagram.

0 Comments:

Post a Comment

<< Home