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

Bug 357421

Summary: Utility jars in EAR50/lib or EAR/ cannot be edited in in EAR Java EE Module Dependencies page
Product: [WebTools] WTP Java EE Tools Reporter: Diego Sahagun <diegosr>
Component: jst.j2eeAssignee: Diego Sahagun <diegosr>
Status: RESOLVED FIXED QA Contact: Chuck Bridgham <cbridgha>
Severity: normal    
Priority: P3 CC: ccc, shr31223
Version: 3.0.5Flags: cbridgha: review+
Target Milestone: 3.0.5 P   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Fix patch ccc: iplog+

Description Diego Sahagun CLA 2011-09-12 17:16:03 EDT
Build Identifier: 3.4.2_v20090122

The entries for utility Jars in this page are disabled making impossible to disable the utility or activate the "In Lib Dir" option.

Reproducible: Always

Steps to Reproduce:
1. Create an EAR project with all defaults
2. Open the Import J2EE Utility Jar wizard
3. Select the option to "Copy utility jars into an existing EAR from an external location"
4. Locate the Utility jar and finish the wizard
5. Select the EAR you created and bring up the properties page
6. Go to Java EE Module dependencies page and see the disabled item
Comment 1 Diego Sahagun CLA 2011-09-12 17:18:54 EDT
The fix for Bug 349741 uncovered some additional issues that were not caught during testing but during verification instead.
Comment 2 Diego Sahagun CLA 2011-09-13 15:40:32 EDT
Created attachment 203292 [details]
Fix patch

I noticed that the method getWorkspaceRelativePath() form VirtualArchiveComponent class is not consistent on its results, it returns a path including the EAR when the utility jars were just copied (not in component file) and returns a path excluding the EAR when utility jars have been imported (present in component file). The method is deprecated in newer streams so the fix to this is basically add some shielding code to the places where the method is used.
Comment 3 Chuck Bridgham CLA 2011-09-19 14:00:39 EDT
approved
Comment 4 Carl Anderson CLA 2011-09-19 21:30:51 EDT
The Java 6 method Arrays.copyOfRange() caused errors.
Comment 5 Diego Sahagun CLA 2011-09-27 16:46:54 EDT
Resolving since this was committed and released on Sept 23 by Carl.

Thanks Carl for the Arrays.copyOfRange() correction.