Search

3.7. Class Loading and Subdeployments

download PDF

3.7.1. Modules and Class Loading in Enterprise Archives

Enterprise Archives (EAR) are not loaded as a single module like JAR or WAR deployments. They are loaded as multiple unique modules.
The following rules determine what modules exist in an EAR.
  • Each WAR and EJB JAR subdeployment is a module.
  • The contents of the lib/ directory in the root of the EAR archive is a module. This is called the parent module.
These modules have the same behavior as any other module with the following additional implicit dependencies:
  • WAR subdeployments have implicit dependencies on the parent module and any EJB JAR subdeployments.
  • EJB JAR subdeployments have implicit dependencies on the parent module and any other EJB JAR subdeployments.

Important

No subdeployment ever gains an implicit dependency on a WAR subdeployment. Any subdeployment can be configured with explicit dependencies on another subdeployment as would be done for any other module.
The implicit dependencies described above occur because JBoss EAP 6 has subdeployment class loader isolation disabled by default.
Subdeployment class loader isolation can be enabled if strict compatibility is required. This can be enabled for a single EAR deployment or for all EAR deployments. The Java EE 6 specification recommends that portable applications should not rely on subdeployments being able to access each other unless dependencies are explicitly declared as Class-Path entries in the MANIFEST.MF file of each subdeployment.
Red Hat logoGithubRedditYoutubeTwitter

Learn

Try, buy, & sell

Communities

About Red Hat Documentation

We help Red Hat users innovate and achieve their goals with our products and services with content they can trust.

Making open source more inclusive

Red Hat is committed to replacing problematic language in our code, documentation, and web properties. For more details, see the Red Hat Blog.

About Red Hat

We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.

© 2024 Red Hat, Inc.