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

Bug 326549

Summary: Web Service Wizard Can Default to invalid project type
Product: [WebTools] WTP Webservices Reporter: Mark Hutchinson <mahutch>
Component: jst.wsAssignee: Mark Hutchinson <mahutch>
Status: RESOLVED FIXED QA Contact: Keith Chong <keith.chong.ca>
Severity: normal    
Priority: P3 Flags: keith.chong.ca: review+
Version: 3.2.2   
Target Milestone: 3.2.2 P   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
proposed patch keith.chong.ca: iplog+

Description Mark Hutchinson CLA 2010-09-29 11:16:27 EDT
We are using the org.eclipse.jst.ws.consumption.ui.serviceRuntimes extension point.  We contribute a couple different service runtimes for creating EJB Web Services, with different "required-facet-version" elements.   Some servers do not support all of the required facet versions.  not every server supports every service runtime.

The bug is that sometimes the web service runtime that is selected as the default by our wizard is not supported by any "server runtime" installed.  When doing the defaulting the server runtime is not being considered.

This results in a NPE being logged:
java.lang.NullPointerException
    at org.eclipse.jst.ws.internal.creation.ui.widgets.runtime.ServerRuntimeSelectionWidgetDefaultingCommand.execute(ServerRuntimeSelectionWidgetDefaultingCommand.java:201)
    at org.eclipse.jst.ws.internal.creation.ui.widgets.ServerWizardWidget.refreshServerRuntimeSelection(ServerWizardWidget.java:1563)
    at org.eclipse.jst.ws.internal.creation.ui.widgets.ServerWizardWidget.access$24(ServerWizardWidget.java:1547)


Also the "service project" selected by the wizard can be invalid.  If the user tries to proceed with through the wizard with this invalid project they will hit another NPE:

   at org.eclipse.jst.ws.internal.creation.ui.extension.PreServiceDevelopCommand.execute(Unknown Source)
      at org.eclipse.wst.command.internal.env.core.fragment.CommandFragmentEngine.runCommand(Unknown Source)
      at org.eclipse.wst.command.internal.env.core.fragment.CommandFragmentEngine.visitTop(Unknown Source)
      at org.eclipse.wst.command.internal.env.core.fragment.CommandFragmentEngine.moveForwardToNextStop(Unknown Source)
      at org.eclipse.wst.command.internal.env.ui.widgets.SimpleCommandEngineManager$6.run(Unknown Source)
      at org.eclipse.jface.operation.ModalContext.runInCurrentThread(Unknown Source)
      at org.eclipse.jface.operation.ModalContext.run(Unknown Source)


So basically we are not considering all of the information specified in the extension when doing our defaulting.  We are picking the wrong default webservice runtime and project type.  If the user tries to proceed through the wizard with these incorrect defaults then they will run into errors.
Comment 1 Mark Hutchinson CLA 2010-09-29 11:41:31 EDT
Created attachment 179860 [details]
proposed patch
Comment 2 Keith Chong CLA 2010-09-30 11:42:13 EDT
The patch looks good.
Comment 3 Keith Chong CLA 2010-10-05 00:06:01 EDT
Patch has been released to 3.2.2 P.
Comment 4 Keith Chong CLA 2010-10-05 00:08:05 EDT
Hi Mark, can you please ensure you apply this fix for WTP 3.3 and 3.2.3?

Thanks.
Comment 5 Mark Hutchinson CLA 2010-10-15 11:51:31 EDT
Committed to R3_2_maintenance and head.
Comment 6 Keith Chong CLA 2010-10-15 18:40:06 EDT
Released to 3.3.