Packaging J2EE Applications

The J2EE platform simplifies the deployment of enterprise applications. This is accomplished by packaging applications and components into independent modules. Each module contains all the components along with a deployment descriptor. The deployment descriptor, as its name implies, describes each component's properties, the relationship between components, and the customized common services to be provided by the container at runtime. Typically, all components of one tier are packaged into a separate module.

A J2EE application consists of one or more J2EE modules and one J2EE application deployment descriptor. An application deployment descriptor contains a list of modules and how to configure them. A J2EE application is represented by an EAR file, which must contain at least one JAR file. In addition, an EAR file might contain any number of WAR files and RAR files, or none at all (see Figure 15.5). The standard deployment descriptor for the J2EE application is application.xml, and is located in the META-INF directory of the EAR file.

Figure 15.5. J2EE application's deployment descriptors.


Each J2EE module consists of one or more J2EE components for the same container type and one component deployment descriptor of that type.

The three types of J2EE modules are

  • Application client modules— Contain class files and a deployment descriptor. Application client modules are packaged as JAR files with a .jar extension, which will be deployed into the client application container. The standard deployment descriptor for this module is application-client.xml, and is located in the META-INF directory of the JAR file.

  • Web modules— Consist of JSP files, class files for servlets, GIF and HTML files, and a Web deployment descriptor. Web modules are packaged as JAR files with a .war extension, which will be deployed into the Web container. The standard deployment descriptor for this module is web.xml, and is located in the WEB-INF directory of the WAR file.

  • EJB modules— Consist of class files for all the deployed EJBs and a deployment descriptor. EJB modules are packaged as JAR files with a .jar extension, which will be deployed into the EJB container. The standard deployment descriptor for this module is ejb-jar.xml, and is located in the META-INF directory of the JAR file.

  • Resource adapter modules— Comprise all Java interfaces, classes, native libraries, and the resource adapter deployment descriptor. Resource adapter modules are packaged as RAR files with an .rar extension. The standard deployment descriptor for this module is ra.xml, and is located in the META-INF directory of the JAR file.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.21.98.207