Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 368198 - Mismatch between web context root in EAR's DD and Web project's metadata
Summary: Mismatch between web context root in EAR's DD and Web project's metadata
Status: RESOLVED INVALID
Alias: None
Product: WTP Java EE Tools
Classification: WebTools
Component: jst.j2ee (show other bugs)
Version: 3.3.1   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.3.2   Edit
Assignee: Roberto Sanchez Herrera CLA
QA Contact: Chuck Bridgham CLA
URL:
Whiteboard: PMC_approved
Keywords:
Depends on:
Blocks:
 
Reported: 2012-01-09 17:07 EST by Roberto Sanchez Herrera CLA
Modified: 2012-01-26 10:09 EST (History)
2 users (show)

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


Attachments
Poposed patch for 3.3.2 and 3.4 (7.63 KB, patch)
2012-01-10 16:13 EST, Roberto Sanchez Herrera CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Roberto Sanchez Herrera CLA 2012-01-09 17:07:18 EST
If you have an EAR project with deployment descriptor (DD) and a Web project that is part of that EAR, and you change the web context root in the EAR's DD, the web context root specified in the component file of the web project is not updated, and now there is a mismatch between the two.

Steps to recreate:

1. Create an EAR 1.4 project with a web module
2. Open the deployment descriptor of the EAR
3. change the value of the context-root tag inside the web module and save the DD
4. Open the .settings/org.eclipse.wst.common.component file of the web project (or go to the properties of the project and select Web project settings). You will see the previous value.
Comment 1 Roberto Sanchez Herrera CLA 2012-01-10 16:13:08 EST
Created attachment 209287 [details]
Poposed patch for 3.3.2 and 3.4

This patch adds a validation message to the EAR validator, to tell the user about this mismatch, using a warning
Comment 2 Chuck Bridgham CLA 2012-01-10 16:14:50 EST
approved
Comment 3 Roberto Sanchez Herrera CLA 2012-01-10 17:27:20 EST
PMC Review requested due to UI change (new warning message is added)


   * 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. 

Requesting PMC for UI changes (new warning message) in maintenance release. The problem is that the web context root of a web module in the EAR deployment descriptor can be different from the web context root in the web project component file. This can cause problems when running artifact in the web project like JSPs. This patch adds a new warning for these cases.

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

The user can change the web context root using the properties page of the web project to match the context root specified in the EAR DD. However, currently we do not tell the user about this mismatch. 


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

Tested manually, reviewed by Chuck Bridgham

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

The EAR validator now validates each web project specified in the DD. It compares the web context root from the EAR DD and the context root from the component file of the web project. If they do not match, a new warning is shown. 

    * What is the risk associated with this fix? 

Low.
Comment 4 Chuck Bridgham CLA 2012-01-11 16:52:25 EST
This is a safe fix, and provides a valuable validation
Comment 5 Roberto Sanchez Herrera CLA 2012-01-26 10:09:04 EST
After more discussion, we came to the conclusion that the web context root from the EAR and the web context root from the web project metadata should not depend on each other. The context root from the metadata should be used for standalone web projects, and for web projects in an EAR, the EAR's context root should be used. So, this warning does not make sense after all. Resolving as invalid.