Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 324139 - EJB/App Client jars in library directory appear in 'Modules' node in the project explorer
Summary: EJB/App Client jars in library directory appear in 'Modules' node in the proj...
Status: RESOLVED FIXED
Alias: None
Product: WTP Java EE Tools
Classification: WebTools
Component: jst.j2ee (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.2.2   Edit
Assignee: Aidyl Kareh CLA
QA Contact: Chuck Bridgham CLA
URL:
Whiteboard: PMC_approved
Keywords:
Depends on:
Blocks:
 
Reported: 2010-08-31 17:13 EDT by Aidyl Kareh CLA
Modified: 2010-09-02 11:17 EDT (History)
2 users (show)

See Also:
amkareh: pmc_approved? (david_williams)
amkareh: pmc_approved? (raghunathan.srinivasan)
amkareh: pmc_approved? (naci.dai)
deboer: pmc_approved+
amkareh: pmc_approved? (neil.hauge)
amkareh: pmc_approved? (kaloyan)
cbridgha: review+
amkareh: review?


Attachments
Proposed Patch (10.03 KB, patch)
2010-08-31 17:26 EDT, Aidyl Kareh CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Aidyl Kareh CLA 2010-08-31 17:13:52 EDT
Build Identifier: WTP 3.2.2

There are some issues with how the Project Explorer handles module archives that are placed in the library directory folder. Currently the Project Explorer shows this archives in both the 'Library Directory' and the 'Modules' node. These should be displayed only under the 'Library Directory' node if their deploy path is set to the library directory since they should not be considered modules in this case. Also, if you select 'Java EE Tools' -> 'Generate Deployment Descriptor Stub', you will see that the module archives that are in the library directory folder are also added as modules on the application.xml file.

Steps to Reproduce:
1) Create an EAR project with no DD.
2) Go to the EAR's 'Deployment Assembly' page and select 'Add...' -> 'Archives From File System' -> select an EJB project jar. Make sure that the deploy path is set to the library directory folder. Accept the changes and close the 'Deployment Assembly' page (You will see the problems in the Project Explorer).
3) Select the EAR and right-click 'Java EE Tools' -> 'Generate Deployment Descriptor Stub' (you will the the lib files added as modules)


Reproducible: Always
Comment 1 Aidyl Kareh CLA 2010-08-31 17:26:59 EDT
Created attachment 177895 [details]
Proposed Patch

The attached patch updates the code so that module archives in the library directory are not considered modules and are treated correctly by the Project Explorer and when adding modules to the EAR model. This patch also adds code to clear the archives cache (changes to EarModuleDependenciesPropertyPage class) since there was a timing issue which caused stale archive data to be used by the AddComponentToEnterpriseApplicationOp class.
Comment 2 Jason Sholl CLA 2010-08-31 17:52:47 EDT
approve.
Comment 3 Aidyl Kareh CLA 2010-08-31 18:27:58 EDT
   * Explain why you believe this is a stop-ship defect. Or, if it is a
"hotbug" (requested by an adopter) please document it as such. 

We are currently displaying module archive (EJB/Application Client jars) which have their deploy path set to the library directory folder under the 'Modules' node in the Project Explorer and are also adding them as modules to the application.xml when generating the DD. This behavior is incorrect since this files should be treated as utilities and not modules.

    * Is there a work-around? If so, why do you believe the work-around is
insufficient? 

No.

    * How has the fix been tested? Is there a test case attached to the
bugzilla record? Has a JUnit Test been added? 

Tested through UI.

    * Give a brief technical overview. Who has reviewed this fix? 

The attached patch updates the code so that module archives in the library directory are not considered modules and are treated correctly by the Project Explorer and when adding modules to the EAR model. This patch also adds code to
clear the archives cache (changes to EarModuleDependenciesPropertyPage class) since there was a timing issue which caused stale archive data to be used by the AddComponentToEnterpriseApplicationOp class. This patch has been reviewed by Chuck and Jason.

    * What is the risk associated with this fix? 

Low.
Comment 4 Chuck Bridgham CLA 2010-08-31 19:12:26 EDT
approved
Comment 5 Jason Sholl CLA 2010-09-01 09:48:43 EDT
code checked into head for wtp 3.2.2 and 3.3