Tool Mentor: Assembling J2EE Modules and Applications Using RAD 6.0
Purpose
This tool mentor describes how to produce J2EE archives (WAR, EJB JAR, Client
Application JAR, RAR and EAR files) using RAD 6.0.
It relates to the following RUP information:
Overview
Assembly is the process of combining the components of a J2EE application
into packages (J2EE
Module or J2EE
Application) that can be deployed to an application server. These packages
are formatted as archive files and must conform to a directory structure and
content rules defined by the J2EE Application Assembly and Deployment model.
RAD 6.0 greatly facilitates the assembly process by enforcing the development
of application components in a Project which represents either a J2EE
module or J2EE application. When you create a project, the tool automatically
creates a file directory structure within it that conforms to the J2EE
Application Assembly and Deployment model. As components are subsequently
created through the product's wizards, they are saved by default in the proper
folder within the project. For example, when creating a new JSP file using the
New JSP File wizard, the tool stores it by default in the Web project's
WebContent folder which is the standard location for Web content source
files. In addition, RAD 6.0 also automatically generates all the required J2EE
assembly and deployment artifacts such as the Manifest file and the appropriate
Deployment Descriptors. Assembling a J2EE module or application, therefore,
simply consists of editing the corresponding deployment descriptor(s) as needed
and exporting the project to an archive file. The following steps are performed
in this tool mentor:
- To edit an Enterprise Application project's (EAR)
deployment descriptor:
- In the J2EE perspective's Project Explorer view, expand
Enterprise Applications > project_name.
- Double-click on Deployment Descriptor:
project_name to open the Application Deployment Descriptor
editor.
- Select the appropriate tab at the bottom of the editor view to edit
specific deployment descriptor values.
- Save the deployment descriptor file by selecting File >
Save from the main menu bar.
- To edit a Web project's (WAR) deployment descriptor:
- In the J2EE perspective's Project Explorer view, expand
Web Modules > project_name.
- Double-click on Deployment Descriptor:
project_name to open the Web Deployment Descriptor editor.
- Select the appropriate tab at the bottom of the editor view to edit
specific deployment descriptor values.
- Save the deployment descriptor file by selecting File >
Save from the main menu bar.
- To edit an EJB project's (EJB JAR) deployment descriptor:
- In the J2EE perspective's Project Explorer view, expand
EJB Modules > project_name.
- Double-click on Deployment Descriptor:
project_name to open the EJB Deployment Descriptor editor.
- Select the appropriate tab at the bottom of the editor view to edit
specific deployment descriptor values.
- Save the deployment descriptor file by selecting File >
Save from the main menu bar.
- To edit an Application Client project's (Application
Client JAR) deployment descriptor:
- In the J2EE perspective's Project Explorer view, expand
Application Client Modules > project_name.
- Double-click on Deployment Descriptor:
project_name to open the Client Deployment Descriptor editor.
- Select the appropriate tab at the bottom of the editor view to edit
specific deployment descriptor values.
- Save the deployment descriptor file by selecting File >
Save from the main menu bar.
- To edit a Connector project's (RAR) deployment
descriptor:
- In the J2EE perspective's Project Explorer view, expand
Connector Modules > project_name.
- Double-click on Deployment Descriptor:
project_name to open the XML editor on the ra.xml
file.
- Edit the XML file to change specific deployment descriptor values.
- Save the deployment descriptor file by selecting File >
Save from the main menu bar.
Although the tool is setup by default to automatically validate resources
when you save them, it is a good idea to manually validate your entire project
before exporting it to an archive file (Note that you can override and change
which validators are run against your project by right-clicking on it and
selecting Properties > Validation).
- In the J2EE perspective's Project Explorer view, right-click on
the project_name.
- Select Run Validation.
- After the validation is completed, check the Problems view. If
errors are listed, resolve them before proceeding to the next step.
- To export an Enterprise Application project to an EAR
file:
- In the J2EE perspective's Project Explorer view, right-click on
the project_name.
- Select Export > EAR file.
- In the Export wizard, specify the desired name and location of
the EAR file.
- Optionally select to:
- Export source files
- Overwrite existing file if you are exporting to an
existing EAR file and do not want to be warned about overwriting it
- Include project build paths and meta-data files to
preserve the original names of projects included in or referenced by the
application project and maintain classpath dependencies. This allows you
to later import the EAR into another workspace and have its modules be
imported as a binary projects.
- Click Finish. The wizard exports the contents of the
application project to the specified EAR file.
- To export a Web project to a WAR file:
- In the J2EE perspective's Project Explorer view, right-click on
the project_name.
- Select Export > WAR file.
- In the Export wizard, specify the desired name and location of
the WAR file.
- Optionally select to:
- Export source files
- Overwrite existing file if you are exporting to an
existing WAR file and do not want to be warned about overwriting it
- Click Finish. The wizard exports the contents of the
web project to the specified WAR file.
- To export an EJB project to an EJB JAR file:
- In the J2EE perspective's Project Explorer view, right-click on
the project_name.
- Select Export > EJB JAR file.
- In the Export wizard, specify the desired name and location of
the JAR file.
- Optionally select to:
- Export source files
- Overwrite existing file if you are exporting to an
existing JAR file and do not want to be warned about overwriting it
- Click Finish. The wizard exports the contents of the
EJB project to the specified JAR file.
- To export an Application Client project to an Application Client
JAR file:
- In the J2EE perspective's Project Explorer view, right-click on
the project_name.
- Select Export > App Client JAR file.
- In the Export wizard, specify the desired name and location of
the JAR file.
- Optionally select to:
- Export source files
- Overwrite existing file if you are exporting to an
existing JAR file and do not want to be warned about overwriting it
- Click Finish. The wizard exports the contents of the
Application Client project to the specified JAR file.
- To export a Connector project to a RAR file:
- In the J2EE perspective's Project Explorer view, right-click on
the project_name.
- Select Export >RAR file.
- In the Export wizard, specify the desired name and location of
the RAR file.
- Optionally select to:
- Export source files
- Overwrite existing file if you are exporting to an
existing RAR file and do not want to be warned about overwriting it
- Click Finish. The wizard exports the contents of the
Connector project to the specified RAR file.
| |
|