Community
Participate
Working Groups
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.
approve
Committed to R3_0_maintenance