Community
Participate
Working Groups
Created attachment 179884 [details] Patch file alters EARComponentImportOperation.java If the deploy-path of any modules are modified before exporting a project as an Ear, when you later import the EAR, you will see that the generated archiveName fields in the 'org.eclipse.wst.common.component' file are set to the full path of the module and the deploy-path is always set to the default, '/'. Steps to recreate: 1) Create an EAR 5 project with all default modules and with a DD 2) Open the application.xml file and modify all the URIs to include a folder (i.e. /1/TestEAR5Web.war, /2/TestEAR5EJB.jar, etc) 3) Export the EAR project. 4) Import the EAR file. (You will see that the archiveName fields in the 'org.eclipse.wst.common.component' file are generated as full paths, ie: '1/TestEAR5Web.war' and the deploy-paths are set to '/') Proposed patch: Changes the value passed to the TARGET_COMPONENTS_TO_URI_MAP to the last segment of the full uri path (the file name), this map is used by getArchiveName and was previously being passed the full uri path. Sets the TARGET_COMPONENTS_DEPLOY_PATH_MAP to a mapping of each component to each components uri minus the file name ... previously the deploy path map field was never being set, and when checked, the defualt "/" was used when nothing was found.
Review requests removed, issues found in proposed patch
While investigating the problems in this patch it was discovered that, in EARComponentImportOperation.java, a check (line 153) of whether or not a component is already in the DD or not, is incorrect; At import, all components are currently treated as if they are not already in the DD. To Recreate: -Create a new Ear project with a DD and all default modules. -Export the Ear, then Import the Ear. -Compare the component file and the aplication.xml, the module id entries are missing from the component file.
Created attachment 179971 [details] Patch file alters EARComponentImportOperation.java new proposed patch: -Fixes problems with original patch -Fixes the newly discovered issue of missing module IDs
approve
Created attachment 179989 [details] ArchiveName and DeployPath fix It has been decided that the issue involving the component ID not being added to the component file will be separated out and targeted for 802 for a more in depth rewrite of this import code. As such, a new patch has been posted here, rolling back to the patch fixes addressing the problems with the first proposed patch, but excluding the added fix for the missing component ID.
code checked into both 32M and HEAD for WTP 3.2.3 and 3.3 respectively.
Committed to R3_2_2_patches