Verifying archive files

Verifying an archive file consists of validating code in the files.

 

Before you begin

This article assumes you have assembled an archive file into a module using an assembly tool such as the Application Server Toolkit (AST) or Rational Web Developer. Thus, this article assumes that you have done the following:

  1. Started the assembly tool;

  2. Configured the assembly tool for work on J2EE modules; and

  3. Migrated an existing module to the assembly tool or created a new module.

 

Overview

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 EAR and 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

  1. Optional: Specify whether you want automatic code validation during a resource change or during a build. The default is for automatic code validation.

    1. In the Project Explorer view, right-click on a project.

    2. Click Properties > Validation.

    3. Ensure that the Run validation options for builds and for automatic validation are selected. Select Override validation preferences to disable automatic code validation.

    4. If you changed the Validation settings, click Apply or OK.

  2. 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.

    1. In the Project Explorer view, right-click the project containing the code that you want to validate.

    2. Click Properties > Validation.

    3. Select Override validation preferences.

    4. Select the validators you want checked during code validation.

    5. If you changed the Validation settings, click Apply or OK.

  3. Right-click the project containing the code that you want to validate and click Run Validation to manually validate the code.

 

Result

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, one 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.


 

See Also


Application assembly and J2EE applications

 



 

 

Rational is a trademark of the IBM Corporation in the United States, other countries, or both.