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

Bug 324139

Summary: EJB/App Client jars in library directory appear in 'Modules' node in the project explorer
Product: [WebTools] WTP Java EE Tools Reporter: Aidyl Kareh <amkareh>
Component: jst.j2eeAssignee: Aidyl Kareh <amkareh>
Status: RESOLVED FIXED QA Contact: Chuck Bridgham <cbridgha>
Severity: normal    
Priority: P3 CC: amkareh, jsholl
Version: unspecifiedFlags: 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?
Target Milestone: 3.2.2   
Hardware: PC   
OS: Windows XP   
Whiteboard: PMC_approved
Attachments:
Description Flags
Proposed Patch none

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