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

Bug 286859

Summary: EJB Projects created by web Service Wizards does not add the ejbModule as a source folder
Product: [WebTools] WTP Webservices Reporter: Zina Mostafia <zina>
Component: jst.wsAssignee: Zina Mostafia <zina>
Status: RESOLVED FIXED QA Contact: Keith Chong <keith.chong.ca>
Severity: major    
Priority: P3 CC: ccc, keith.chong.ca, yenlu
Version: 3.0.4   
Target Milestone: 3.0.5 P   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Patch to fix this problem
none
Revised Patch
none
Patch with better performance
none
Patch only for the 3.0.5 P stream
none
Fixed version number
none
removed spaces change
none
Updated copyright keith.chong.ca: iplog+

Description Zina Mostafia CLA 2009-08-17 15:22:12 EDT
Build ID: 3.4.2

Steps To Reproduce:
For any EJB Web service/ web service Client scenario, where the Web service / Web Service Client wizard is used to create the Project, the resulting project would be created, but the ejbModule Folder is not defined as a source folder. It is not added to the Project classpath as a source folder.
this is causing some scenarios to fail.


More information:
Need to recognize ejbModule Folder as a source folder for the created EJB Project.

Note, if you use the EJB Project creation wizard, the ejbModule folder would be added to the project classpath as a source folder.
Comment 1 Zina Mostafia CLA 2009-08-17 15:24:30 EDT
Created attachment 144720 [details]
Patch to fix this problem
Comment 2 Yen Lu CLA 2009-08-17 15:46:23 EDT
This should be re-routed to Web services (jst.ws). I also have a few concerns about the patch:

1) The fixEJBClassPath() method will run for any project created by the Web service wizard - regardless of whether or not it is an EJB project.

2) In fixEJBClassPath() itself, the "test" for whether or not a project is an EJB project is simply checking if there is a folder named "ejbModule" relative to the project root. This is too wide-ranging. You may be able to use a Java EE Tools utility method to check whether or not a project is an EJB project or there may be logic in the current command which gives you this information.

3) In the for loop inside the try-catch block of the fixEJBClassPath() method, there is a comparison of the current entry's path with projectRoot.append("ejbModule"). I think you can and should compute this before the try-catch block and store it in a variable for use in the comparison to improve performance.
Comment 3 Zina Mostafia CLA 2009-08-17 15:52:09 EDT
Created attachment 144723 [details]
Revised Patch
Comment 4 Zina Mostafia CLA 2009-08-17 16:27:00 EDT
Created attachment 144732 [details]
Patch with better performance
Comment 5 Zina Mostafia CLA 2009-08-18 14:57:08 EDT
Created attachment 144862 [details]
Patch only for the 3.0.5 P stream

Thi patch is for the 3.0.5 stream, it is a different structure than the 3.1.x and 3.2. Please ignore the previouse patches , as this bugzilla would be only  for the 3.0.5 P stream
Comment 6 Zina Mostafia CLA 2009-08-18 15:05:11 EDT
Created attachment 144863 [details]
Fixed version number
Comment 7 Zina Mostafia CLA 2009-08-18 15:25:07 EDT
Created attachment 144869 [details]
removed spaces change
Comment 8 Keith Chong CLA 2009-08-18 16:09:56 EDT
Created attachment 144875 [details]
Updated copyright
Comment 9 Keith Chong CLA 2009-08-18 16:10:28 EDT
Zina, looks good.  I just updated the copyright header.
Comment 10 Carl Anderson CLA 2009-08-28 09:33:22 EDT
Committed to R3_0_5_patches.

Please clone this bug for the 3.1.x and 3.2 work.
Comment 11 Keith Chong CLA 2009-11-24 14:49:43 EST
Bugs 286868 and 286874 were opened and fixes were applied to 3.2 and 3.1.x