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

Bug 271355

Summary: Cannot get Handle to project error msg thrown
Product: [WebTools] WTP Java EE Tools Reporter: Hari Shankar <hshanka>
Component: jst.j2eeAssignee: Hari Shankar <hshanka>
Status: RESOLVED WONTFIX QA Contact: Chuck Bridgham <cbridgha>
Severity: normal    
Priority: P3 CC: ccc
Version: 3.0.4Flags: cbridgha: review+
Target Milestone: 3.0.5   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
patch none

Description Hari Shankar CLA 2009-04-06 13:51:06 EDT
Build ID: 305

Steps To Reproduce:
                                           
When selecting 6 or more EJB projects and doing a prepare for deployment, the following error is raised:
"Error cannot get handle to the project"

Steps to reproduce:

1) Create 6 EJB projects: EJB1,2,3,4,5,6
2) Select EJB1,2,3,4,5,6 (not the EAR and not the clients)
3) Right-click on the selection and select "Prepare for deployment": the error is raised

More information:
Comment 1 Hari Shankar CLA 2009-04-06 13:51:53 EDT
Created attachment 131028 [details]
patch
Comment 2 Hari Shankar CLA 2009-04-06 13:52:49 EDT
This patch needs to go into 3.1 as well.
Comment 3 Hari Shankar CLA 2009-04-07 10:15:09 EDT
Just wanted to add an explanation for the fix:

The issue here was the J2EEDeployAction's checkEnabled() method was getting a list of modules and working on them, but a dispose had already been called on them (as part of the DeployerRegistry.getSelectedModules() method). This patch refactors the J2eeDeployAction.checkEnabled() method so that we no longer get all the modules at once using the utility method, but iteratively get each module, perform the deploy action and call a dispose on it.

Comment 4 Hari Shankar CLA 2009-04-07 11:19:35 EDT
Cloned this bug for fixing the issue in 1.5.5 - this is tracked by 271463
Comment 5 Chuck Bridgham CLA 2009-04-07 11:31:05 EDT
approve
Comment 6 Hari Shankar CLA 2009-04-07 11:56:53 EDT
Update: 

This issue has actually been fixed indirectly in 3.0.5 by bug 192769, which changed the DeployRegistery.getSelectedModules to return a list of IVirtualComponents (obtained using the ModelProviderManager API) instead of a list of EObjects that were returned by this method pre 3.0.x. This method also does not dispose the modules anymore.

Even though this patch will apply for 3.0.5 (since it basically removes the dependency of J2EEDeployAction.checkEnabled on DeployRegistery.getSelectedModules), I would like to not apply this patch to 3.0.5 since this issue is already fixed in this stream. The clone of this bug - bug 271463 is still applicable and relevant for 1.5.5.

Thanks.