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

Bug 200193

Summary: Cannot use Java project for BUJava
Product: [WebTools] WTP Webservices Reporter: Yen Lu <yenlu>
Component: jst.wsAssignee: Gilbert Andrews <gilberta>
Status: CLOSED FIXED QA Contact: Kathy Chan <kathy>
Severity: major    
Priority: P3 CC: clin, david_williams
Version: 2.0   
Target Milestone: 1.5.5 M155   
Hardware: PC   
OS: Windows XP   
Whiteboard: 155patchCreated
Attachments:
Description Flags
consumption
none
creation
none
fixes the ear creation problem
none
corrections after Kathys review
none
Modified patch
none
consumption.ui patched JAR
none
creation.ui patched JAR
none
wtp 30 patch
none
Delta patch on top of R1_5_5_patch
none
New delta patch that fixes timing problem with classpath update
none
Patch for R2_0_maintenance branch containing all the above patches none

Description Yen Lu CLA 2007-08-16 10:12:40 EDT
Build ID: WTP 2.0.1

Steps To Reproduce:
1. Create a Java project and add a bean.
2. Select the bean in the Java project and launch the Web Service creation wizard.
3. The wizard will produce an error flagging the fact that the type cannot be resolved (since it uses the Web project).


More information:
This scenario has been requested by our product's customers
and there's a fairly straight forward fix that would benefit all extenders if it is made in the framework. If you open up the Web project's properties, there is a J2EE Module Dependencies setting which displays the list of JAR/Module and Projects. The page's description is as follows:

This property page lets you add a Web Library dependency to utility projects, JAR files or classpath entries. Dependencies will be resolved into the WEB-INF\lib folder of the web module at deployment time.

For example, if I have a Java project named "test", it will show up as a jar named "test". If I manually set this up, the Web service generates successfully into my Web project both runs and exports successfully.
Comment 1 Kathy Chan CLA 2007-09-28 16:20:51 EDT
Yen, 

Just want to clarify the scenario.  When you choose to create Web service on a Java bean on the Java project, the Web service wizard would choose a Web project in the workspace or propose to create a new Web project (since bottom-up Web service only support Web project, not Java project).  Then the wizard would issue the error "the class X cannot be loaded via project Y".

Are you proposing then the solution is the following:

- The Web service runtime would allow the creation of Web service on Java project.  When a Java project is choosen, the wizard would then silently create a Web project, generate the Web service there and add a J2EE module dependency to the Java project.

Comment 2 Yen Lu CLA 2007-09-30 08:24:39 EDT
Kathy,

Yes. That is my proposal. This particular module dependency is not really a J2EE module dependency. It configures some project metadata so that when the application is deployed, the class contents of the Java project get bundled into either WEB-INF/classes or WEB-INF/lib of the Web project. This enables the solution for non-J2EE Web Services technologies (i.e. Axis) as well.
Comment 3 Kathy Chan CLA 2007-11-08 11:52:43 EST
Hi Gil,

This would be similar to the add module dependency you already have for adding a Java project as a dependency to a Web project containing the sample JSP code.
Comment 4 Gilbert Andrews CLA 2007-12-04 14:53:18 EST
Created attachment 84451 [details]
consumption
Comment 5 Gilbert Andrews CLA 2007-12-04 14:53:44 EST
Created attachment 84452 [details]
creation
Comment 6 Kathy Chan CLA 2007-12-05 22:51:46 EST
Changing severity to Major since the wizard create the Web project for the user when they started off with Java project, so the user would expect the scenario to be one that is supported and is supposed to work.
Comment 7 Gilbert Andrews CLA 2007-12-06 16:24:16 EST
Created attachment 84671 [details]
fixes the ear creation problem
Comment 8 Gilbert Andrews CLA 2007-12-12 12:17:21 EST
Created attachment 85089 [details]
corrections after Kathys review
Comment 9 Kathy Chan CLA 2007-12-12 18:16:06 EST
Created attachment 85138 [details]
Modified patch

Adding a default constructor to AddModuleDependencyCommand so that we don't have to pass in TestInfo.  Remove the call to addBuildPath which does not seemed to be necessary.
Comment 10 Kathy Chan CLA 2007-12-12 18:23:08 EST
This latest patch has been tested with:

1. Starting with Java project, create bottom-up Web service with no Web project or EAR in workspace.
2. Starting with Java project, create bottom-up Web service by selecting to create a new Web project and EAR.
3. Starting with Java project, create bottom-up Web service by selecting to create into an existing Web project and EAR.
4. Starting with Java project, create bottom-up Web service and also creating client into Java Utility project and then selecting test to create a seperate sample project.

This patch is ready to go into the WTP 1.5.5 patch stream.
Comment 11 Kathy Chan CLA 2007-12-12 18:31:07 EST
Created attachment 85140 [details]
consumption.ui patched JAR
Comment 12 Kathy Chan CLA 2007-12-12 18:31:32 EST
Created attachment 85141 [details]
creation.ui patched JAR
Comment 13 Kathy Chan CLA 2007-12-12 18:34:59 EST
I've attached the exported JAR for the 2 plugins that were changed for this defect.

I've also tested the normal scenario of creating bottom-up Web service in a Web project and that's fine as well.

Comment 14 David Williams CLA 2007-12-18 10:55:39 EST
Patch created in 
http://download.eclipse.org/webtools/patches/drops/R1.5/P-P20071218083716-20071218083716/ 

Be sure to carry forward to 2.0 and 3.0 streams if not done yet. 

The patch is assumed cumulative with all other patches created for 155. 
Comment 15 Gilbert Andrews CLA 2007-12-18 15:00:00 EST
Created attachment 85484 [details]
wtp 30 patch
Comment 16 Kathy Chan CLA 2007-12-18 15:16:31 EST
I've tested the WTP 1.5.5 patch in:

http://download.eclipse.org/webtools/patches/drops/R1.5/P-P20071218083716-20071218083716/ 

I verified that the patch contains the fix for creating Web service starting with Java project.

Yes, we will forward porting this fix into WTP 3.0 and WTP 2.0.2.
Comment 17 Kathy Chan CLA 2007-12-18 17:37:57 EST
Patch review and tested.  It has been committed to HEAD and released as v200712182235.  We still have to commit and test this in R2_0_maintenance.
Comment 18 Kathy Chan CLA 2007-12-20 17:16:46 EST
Created attachment 85688 [details]
Delta patch on top of R1_5_5_patch

This patch should be applied to the original patch that had been checked into R1_5_5_patch branch.  It fixes the regression problem as reported on bug 213640.
Comment 19 David Williams CLA 2007-12-20 17:25:20 EST
re-opening till new fix applied. 
Comment 20 David Williams CLA 2007-12-20 19:58:44 EST
The fixed fix is available at 

http://download.eclipse.org/webtools/patches/drops/R1.5/P-P20071221001459-20071221001459/

Comment 21 Kathy Chan CLA 2007-12-21 11:50:35 EST
Created attachment 85719 [details]
New delta patch that fixes timing problem with classpath update

This patch in on top of the latest patch on R1_5_5_patches stream.  It forces a classpath update to ensure that the J2EE module dependency is properly setup before we try to access the bean.
Comment 22 Kathy Chan CLA 2007-12-21 11:54:48 EST
David, please get a new WTP 1.5.5 patch done containing this fix.  Thanks!
Comment 23 David Williams CLA 2007-12-21 21:30:11 EST
Latest patch has been built into patch builds >=

P-P20071221174739-20071221174739
Comment 24 Kathy Chan CLA 2007-12-22 00:43:08 EST
Created attachment 85747 [details]
Patch for R2_0_maintenance branch containing all the above patches

This patch has been committed and released to R2_0_maintenance.
Comment 25 Kathy Chan CLA 2008-02-28 14:10:50 EST
Please verify the defect you originated with a recent WTP driver which could be found in:

http://download.eclipse.org/webtools/downloads/

If defects in resolved state is not verified within a couple of weeks, the development team might verify and close the defect on the originator's behalf.  Thank you for your attention!

Comment 26 Kathy Chan CLA 2008-06-11 17:02:41 EDT
Verified in adoptor product.