Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 317036 - Wrong Java Facet set during EE import
Summary: Wrong Java Facet set during EE import
Status: RESOLVED FIXED
Alias: None
Product: WTP Java EE Tools
Classification: WebTools
Component: jst.j2ee (show other bugs)
Version: 3.2   Edit
Hardware: PC Windows Server 2003
: P3 normal (vote)
Target Milestone: 3.2.1   Edit
Assignee: Jason Sholl CLA
QA Contact: Chuck Bridgham CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-06-16 08:09 EDT by Jason Sholl CLA
Modified: 2010-06-17 09:51 EDT (History)
1 user (show)

See Also:
cbridgha: review+


Attachments
patch for 3.2.1 (6.87 KB, patch)
2010-06-16 08:11 EDT, Jason Sholl CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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