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

Bug 311374

Summary: Adding binary jar references to EAR project includes extra ".jar" extension
Product: [WebTools] WTP Java EE Tools Reporter: Larry Isaacs <larryisaacs>
Component: jst.j2eeAssignee: Rob Stryker <stryker>
Status: VERIFIED FIXED QA Contact: Chuck Bridgham <cbridgha>
Severity: major    
Priority: P3 CC: cbridgha, ccc
Version: 3.2Flags: cbridgha: review+
Target Milestone: 3.2 RC1   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
Patch to add check for binary references to AddComponentToEnterpriseApplicationDataModelProvider stryker: iplog+

Description Larry Isaacs CLA 2010-05-03 09:49:40 EDT
Created attachment 166774 [details]
Patch to add check for binary references to AddComponentToEnterpriseApplicationDataModelProvider

If you add a binary jar reference (or other type of binary reference for that matter) to an EAR project using the Deployment Assembly page, it will initially appear correct.  However, if you close and re-open the Deployment Assembly page, that reference will include an extra ".jar" on the end of the Deploy Path.

The culprit appears to be AddComponentToEnterpriseApplicationDataModelProvider, where the default map it creates for TARGET_COMPONENTS_TO_URI_MAP is incorrect.  It appears to only be expecting project type references since it is using the project to test for the type of reference, which will be the parent EAR project for binary references.  This causes method to always add ".jar" by default.  As far as I know, binary references will already include the file's extension in the name, so adding another extension is unnecessary.  The attached patch adds an isBinary() check to avoid the extra extension.

Marking major since if a binary war file was referenced, changing the extension to ".jar" could affect deployment.
Comment 1 Carl Anderson CLA 2010-05-03 10:38:33 EDT
Assigning to Rob for initial investigation.
Comment 2 Rob Stryker CLA 2010-05-06 05:09:12 EDT
Patch looks good to me.  Chuck?
Comment 3 Chuck Bridgham CLA 2010-05-06 14:53:01 EDT
approved
Comment 4 Rob Stryker CLA 2010-05-07 02:36:25 EDT
Committed
Comment 5 Larry Isaacs CLA 2010-05-11 15:52:47 EDT
Verified the extra ".jar" is no longer being appended using WTP I-3.2.0-20100511060448 build.