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

Bug 247535

Summary: Wrong server instance(s) is chosen during JAX-RPC sample generation
Product: [WebTools] WTP Webservices Reporter: Kathy Chan <kathy>
Component: jst.wsAssignee: Mark Hutchinson <mahutch>
Status: CLOSED FIXED QA Contact: Keith Chong <keith.chong.ca>
Severity: normal    
Priority: P2 CC: challenger110, keith.chong.ca, mahutch
Version: 3.0Keywords: helpwanted
Target Milestone: 3.1 M7   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
inactive fields and no NPE!
none
proposed patch keith.chong.ca: iplog+

Description Kathy Chan CLA 2008-09-16 14:20:42 EDT
When there's more than 1 profile available for a server, the sample JSP popup might choose the wrong server instance causing errors when running the JSPs.
Comment 1 Kathy Chan CLA 2008-09-30 14:34:03 EDT
Deferring to WTP 3.0.4.
Comment 2 Kathy Chan CLA 2009-01-21 20:14:51 EST
This might require new extension point. 
Comment 3 Keith Chong CLA 2009-03-04 14:06:57 EST
Over to you Mark.
Comment 4 Davoud Salahi Rad CLA 2009-03-11 11:31:32 EDT
I'm a Seneca student trying to fix some bugs. I wanted to add the keyword "needinfo" but I guess that's not possible!! 

Could you please provide more information mainly in terms of steps to reproduce the bug? What is the desired behavior and would you be able to provide any help or hint as to which package or method this bug may belong to? 

Thanks and I look forward to hear from you,
Davoud

  
Comment 5 Keith Chong CLA 2009-03-16 17:22:01 EDT
This cannot be contained for 3.1 M6.  Retargetting.
Comment 6 Mark Hutchinson CLA 2009-03-17 17:01:37 EDT
There isn't much info here, but I think what this bug is describing is that if your right click on a Web Service proxy java class and select "Web Services > Generate JAX-RPC JSPs" there are some combo boxes "Server" and "Server Instance" that allow you to pick the server to run the sample JSPs on.

It looks like the server combo boxes were added as part of bug 221232.

I think the bug is that if there are multiple server instances available the client application is being deployed on more than one server instance.  The Client first is deployed to a server in the InitializeProxyCommand.  This happens before the "Web Service Client Test" page pops up.

Then the client project can be deployed to another server instance (the one selected in the combo box).  I'm not yet sure why we add the client app to the server so early in the process, but I think it would make more sense not to add the client to the server until after the user presses "finish".

Also while investigating this I found another problem (a NPE). I opened bug 269086 for this.

Comment 7 Mark Hutchinson CLA 2009-03-24 10:34:39 EDT
*** Bug 269086 has been marked as a duplicate of this bug. ***
Comment 8 Davoud Salahi Rad CLA 2009-03-24 15:23:53 EDT
Created attachment 129746 [details]
inactive fields and no NPE! 


Trying to reproduce the bug, I get "inactive" server and server instance fields and there are no options in the combo boxes. I also don't get NPE. (the steps are explained in http://challenger110.wordpress.com/2009/03/24/eclipse-wtp-my-approach-to-jax-rpc-bugs/)

1 - Is this result normal!? What can be done to reproduce the bugs (wrong server instance and NPE)?

2 - Due to server combo boxes added as part of bug 221232, is it likely that this bug no longer holds? Since it should now be possible to select the required server instance. 

3 - Does this mean that the implementation of the combo boxes does not have the required functionality?
Comment 9 Mark Hutchinson CLA 2009-03-24 16:35:56 EDT
Created attachment 129757 [details]
proposed patch

There were a few problems here:

1.  Sometimes a web application could be added to the wrong server, or added to more than one server.  This was because we were adding the project to the server before the dialog even appeared.

2.  It was possible to get a null pointer exception if a runtime was selected that did not have any servers created for it.  This is because we were putting the wrong "id" into the combo box, causing us to run into problems finding or creating servers in subsequent commands.

3.  The "server instance" combo box should have been disabled if there were no servers available.

This patch should address these three issues
Comment 10 Keith Chong CLA 2009-04-01 16:24:36 EDT
Patch has been released for 3.1 M7.
Comment 11 Mark Hutchinson CLA 2009-05-04 17:09:45 EDT
verified on wtp-3.1-20090430