Sun GlassFish Enterprise Server v3 Prelude Application Deployment Guide

About Modules

A module is a collection of one or more components that execute in the same container type (for example, web or EJB) with annotations or deployment descriptors of that type. In the Java EE modules, one descriptor is Java EE standard, the other is optional and Enterprise Server specific. Annotations can be used instead of Java EE standard descriptors.

Types of modules are as follows:

Package definitions must be used in the source code of all modules so the class loader can properly locate the classes after the modules have been deployed.

Because the information in a deployment descriptor is declarative, it can be changed without requiring modifications to source code. At run time, the Java EE server reads this information and acts accordingly.

EJB JAR and Web modules can be deployed separately, outside of any application. EJB components are assembled in a JAR file with annotations or ejb-jar.xml and sun-ejb-jar.xml deployment descriptors. Web components are assembled in a WAR file with annotations or web.xml and sun-web.xml deployment descriptors.