Verifying an archive file consists of validating code in the files.
Before you begin
This topic assumes you have assembled an archive file into a module
using an
assembly tool such
as the Application Server Toolkit (AST), Rational Application Developer (RAD)
or Rational Web Developer. Thus, this topic assumes that you
have done the following:
- Started the assembly tool;
- Configured the assembly tool for
work on Java 2 Platform, Enterprise Edition (J2EE) modules; and
- Migrated an existing
module to the assembly tool or created a
new module.
About this task
An assembly tool validates code when you request code validation
manually, automatically during a resource change, and automatically during
a build.
As part of validating the code, the validation checks for the following:
- Required deployment properties contain values.
- Values specified for environment entries match their associated Java types.
- In both enterprise archive (EAR) and Web archive (WAR) files:
- The target enterprise bean of the link exists for enterprise bean (EJB)
references.
- The target role exists for security role references.
- Security roles are unique.
- Each module listed in the deployment descriptor exists in the archive
for EAR files.
- Files for icons, servlets, error and welcome pages listed in the deployment
descriptor have corresponding files in the archive for WAR files.
- For EJB modules:
- All class files referenced in the deployment descriptor exist in the JAR
file.
- Method signatures for enterprise bean home, remote and implementation
classes comply with the EJB 2.0 or 2.1 specification.
Procedure
- Optional: Specify whether you want automatic code validation
during a resource change or during a build. The default is for
automatic code validation.
- In the Project Explorer view, right-click on a project.
- Click Properties > Validation.
- Ensure that the Run validation options for builds and
for automatic validation are selected. Select Override validation
preferences to disable automatic code validation.
- If you changed the Validation settings, click Apply or OK.
- Optional: Specify validation options for a project.
The default is to check all validators for a project during code validation.
For an enterprise application project, the validators might be for DTD, EAR,
Web services, XML, XML schema, or XSL files.
- In the Project Explorer view, right-click the project containing
the code that you want to validate.
- Click Properties > Validation.
- Select Override validation preferences.
- Select the validators you want checked during code validation.
- If you changed the Validation settings, click Apply or OK.
- Right-click the project containing the code that you want to validate
and click Run Validation to manually validate the code.
Results
The results of the code validation are shown in a Tasks view. For
information on the results, select an entry in the Tasks view, press F1, and
click Tasks view.
What to do next
If your module uses Web services, refer to
Generating code for Web service deployment. Otherwise,
you are ready to
deploy the
module onto the application server.
For EJB modules, you can generate
EJB deployment code and deploy the module to a target server in one step. In the Project Explorer view,
right-click on the EJB project and click Deploy.