Assemble an enterprise bean JAR file into an EAR file
Overview
This task explains how to assemble the JAR file that you created in the previous task into an 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.
You can assemble Java-based Web services modules with assembly tools provided with WAS.
Before assembling a Web services-enabled EAR file assemble an enterprise bean JAR file to enable for Web services.
Procedure
- Start an assembly tool.
Enable J2EE and Web categories.
- 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
- Metadata describing the applications or application.xml files
Results
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.jarAn 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 WAS.
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