Bug 237828 - Enterprise Application validation not designed for referenced Java EE 5 projects
Summary: Enterprise Application validation not designed for referenced Java EE 5 projects
Status: RESOLVED FIXED
Alias: None
Product: WTP Java EE Tools
Classification: WebTools
Component: jst.j2ee (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.0.1   Edit
Assignee: Ian Tewksbury CLA
QA Contact: Chuck Bridgham CLA
URL:
Whiteboard:
Keywords: contributed
Depends on:
Blocks:
 
Reported: 2008-06-19 13:38 EDT by Ian Tewksbury CLA
Modified: 2008-07-02 23:55 EDT (History)
2 users (show)

See Also:
cbridgha: review+
jsholl: review+


Attachments
Patch (5.59 KB, patch)
2008-06-19 13:38 EDT, Ian Tewksbury CLA
bjorn.freeman-benson: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ian Tewksbury CLA 2008-06-19 13:38:53 EDT
Created attachment 105433 [details]
Patch

The validation framework for Enterprise Applications was not designed with Java EE 5 in mind.  Therefor if a Java EE 5.0 project (EJB 3, Web 2.5, AppClient 5) is added as a reference to a EAR 1.4 class cast exceptions are thrown because of validation.

Granted this validation should not run in this mixed EAR case because the facet version on the EAR 1.4 needs to be changed to 5.0 to legally contains 5.0 projects, and if this is done the old validation framework is not run on the EAR.  But it seems many people are not updating the facet version of the EAR so when validation is run errors are logged and strange validations messages appear.

The attached patch puts a check in UIEarValidator before any other validation takes place to be sure that this is not the mixed EAR case where the facet version has not been set to 5.0.  If it is then a more clear validation error is set and the rest of the EAR validation is aborted, thus avoiding any of the class cast exceptions later on in the validation.

The newly added validation message in 'earvalidation.properties' is:
JEE5_PROJECT_REFERENCED_BY_PRE_JEE5_EAR=Facet version for Enterprise Application project {0} must be 5.0 to contain Java EE 5.0 project {1}.

Where {0} is the name of the EAR project and {1} is the name of the referenced project, validation error target is set to the EAR project.

NOTE: A check to be sure that the EAR being validated is a legacy EAR (<=1.4) is done because of Bug 22484 causing Java EE 5.0 EARs to get validated by this validator if a manual validation is run.  If it is the case where it is a Java EE 5.0 EAR then all validation is skipped because the validator is not designed for 5.0 EARs.
Comment 1 Chuck Bridgham CLA 2008-07-01 16:16:20 EDT
approve
Comment 2 Carl Anderson CLA 2008-07-02 23:55:07 EDT
Committed to R3_0_maintenance