Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 317036

Summary: Wrong Java Facet set during EE import
Product: [WebTools] WTP Java EE Tools Reporter: Jason Sholl <jsholl>
Component: jst.j2eeAssignee: Jason Sholl <jsholl>
Status: RESOLVED FIXED QA Contact: Chuck Bridgham <cbridgha>
Severity: normal    
Priority: P3 CC: ccc
Version: 3.2Flags: cbridgha: review+
Target Milestone: 3.2.1   
Hardware: PC   
OS: Windows Server 2003   
Whiteboard:
Attachments:
Description Flags
patch for 3.2.1 none

Description Jason Sholl CLA 2010-06-16 08:09:28 EDT
There are two fixes in this bug.  

The first fix in J2EEComponentImportDataModelProvider is to ensure the java facet is properly updated in the facetedprojectworkingcopy.  There was a scenario outside the UI where this update was not occurring resulting in a java facet version of 1.4 set along with an EJB 3.1 version which then results in a failed import because of facet version constraint violation exceptions.

The second fix in JavaEEArchiveUtilities is to consider the file extension (when available) along with the deployment descriptor in determining the archive type.  The particular archive which was failing prior to this fix was a '.jar' with both an application.xml and an ejb-jar.xml file (it was considering it an EAR).  The new code will look for ejb-jar.xml (and application-client.xml) prior to application.xml for a '.jar' file, and the opposite for a '.ear' file.  Likewise, for '.war', and '.rar', it will look first for the expected deployment descriptor respectively before considering any of the others.

This has been tested headlessly, with the UI, and with all JUnits.
Comment 1 Jason Sholl CLA 2010-06-16 08:11:07 EDT
Created attachment 172031 [details]
patch for 3.2.1
Comment 2 Chuck Bridgham CLA 2010-06-16 10:52:13 EDT
approve
Comment 3 Carl Anderson CLA 2010-06-17 09:51:37 EDT
Committed to HEAD for WTP 3.2.1