Assembling an enterprise bean JAR file into an EAR file

This task explains how to assemble the enterprise bean Java archive (JAR) file that you created in the previous task into an enterprise archive (EAR) file with an assembly tool. Assembling the JAR file, and now the EAR file, are required tasks to enable Java code for Web services.

 

Before you begin

We can assemble Web Services for J2EE modules with assembly tools provided with WebSphere Application Server.

You must configure the assembly tool before use it. Before assembling a Web services-enabled EAR file assemble an enterprise bean JAR file that you want to enable for Web services. To learn more about the artifacts that are needed for the assembly of the enterprise bean JAR file see Assemble an enterprise bean JAR file from Java code that is enabled for Web services.

 

Overview

To assemble a Web services-enabled EAR file:

 

Procedure

  1. Start the assembly tool. The assembly tools, Application Server Toolkit (AST) and Rational Web Developer, provide a graphical interface for developing code artifacts, assembling the code artifacts into various archives (modules) and configuring related J2EE V1.2, 1.3 or 1.4 compliant deployment descriptors.

  2. Assemble the Web services-enabled JAR file into an EAR file. The EAR file can contain an enterprise bean or application client JAR files, WAR files, Web applications, and metadata describing the applications or application.xml files.

 

Result

A Web services-enabled EAR file.

 

Example

In the following example, there is an application.xml deployment descriptor packaged with a Web services-enabled JAR file called AddressBook.jar that is packaged into an EAR file called AddressBook.ear. The EAR file contains:

META-INF/MANIFEST.MF
META-INF/application.xml
AddressBook.jar

An example of the application.xml deployment descriptor is as follows:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE application PUBLIC "-//Sun Microsystems, Inc.//DTD J2EE Application 1.3//EN" 
"http://java.sun.com/dtd/application_1_3.dtd">
  <application id="Application_ID">
    <display-name>AddressBookJ2WEE</display-name>
    <description>AddressBook EJB Example from Java</description>
    <module id="EjbModule_1">
      <ejb>AddressBook.jar</ejb>
    </module>
  </application>

 

What to do next

Enable the EAR file. Then, deploy the EAR file into WebSphere Application Server.


 

Related Tasks


Starting an assembly tool
Assembling a JAR file that is enabled for Web services from an enterprise bean
Assembling a Web services-enabled enterprise bean JAR file from a WSDL file
Enabling an EAR file for Web services