Validating code in enterprise applications
The workbench provides manual code validation, code validation during a build, and automatic code validation of project resources. Manual code validation is explicitly invoked by the user, and it immediately validates the resources contained in a selected project. Build validation occurs when you manually invoke a build. Automatic code validation occurs whenever an automatic incremental build occurs as a result of a resource change, such as when a project is created, a .java file is edited, or a model file (such as ejb-jar.xml, .mapxmi, .rdbxmi, or ibm-ejb-jar-ext.xmi) is changed or saved. By default, manual code validation and automatic code validation are enabled in the preferences.
On the Properties page for each enterprise application module project, you will find a list of validators that you can run against a selected project. The list of validators is different for each type of project. For example, an enterprise application project has the following validators:
- DTD Validator
- EAR Validator
- EAR XML Validator
- Web Accessibility Validator
- WSDL Validator
- XML Schema Validator
- XSL Validator
Common validation errors and solutions
You may encounter these common error messages when you validate your projects.J2EE Validators
This table lists the validators that are available for the different project types and gives a brief description of each validator.Enabling automatic code validation
If you want validation to occur automatically during an automatic incremental build that occurs as a result of a resource change, you can enable automatic code validation.Enabling build validation
You can enable validation to occur during a build of a project.Disabling a validator
You can disable one or more validators for a project.Overriding global validation preferences
For a given project, you can override the global validation preferences.Manually validating code
When you run a manual validation, all resources in the selected project are validated with the validators that are selected on the Validation page of the project Properties dialog.Selecting code validators
You can select specific validators to run for a project during manual and automatic code validation.Related reference
Common validation errors and solutions
J2EE Validators