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

Bug 351798

Summary: Top Down Java Bean Web Service fails with NPE if there is no Source folder in the project
Product: [WebTools] WTP Webservices Reporter: Tilak Sharma <tilak1233>
Component: jst.wsAssignee: Project Inbox <jst.ws.jaxws-inbox>
Status: NEW --- QA Contact: Keith Chong <keith.chong.ca>
Severity: minor    
Priority: P3    
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Tilak Sharma CLA 2011-07-12 03:45:12 EDT
Build Identifier: I20100608-0911

Clicking Next in the Web Service wizard with "Top Down Java Bean Web Service" option throws NPE if there is no Source folder in the project.

Reproducible: Always

Steps to Reproduce:
1. Create a WSDL inside a project which doesn't have Source folder (src).
2. Now select the "Generate Java Bean Skeleton" option under Web Services group or launch the Web Service wizard.
3. Observe that "Top Down Java Bean Web Service" is selected as the Web Service Type
4. Click Next and Null Pointer Exception is thrown due to absence of the "src" folder.
Comment 1 Tilak Sharma CLA 2011-07-12 03:47:28 EDT
Workaround is to make sure that there is a "src" folder in the project before launching the wizard.

The exception thrown is:

java.lang.NullPointerException
      at org.eclipse.jst.ws.jaxws.core.utils.JDTUtils.getJavaProjectSourceDirectoryPath(JDTUtils.java:181)
      at org.eclipse.jst.ws.jaxws.core.utils.JDTUtils.getJavaProjectSourceDirectoryPath(JDTUtils.java:169)
      at org.eclipse.jst.ws.internal.cxf.creation.core.commands.WSDL2JavaDefaultingCommand.execute(WSDL2JavaDefaultingCommand.java:108)
      at org.eclipse.wst.command.internal.env.core.fragment.CommandFragmentEngine.runCommand(CommandFragmentEngine.java:419)
      at org.eclipse.wst.command.internal.env.core.fragment.CommandFragmentEngine.visitTop(CommandFragmentEngine.java:359)
      at org.eclipse.wst.command.internal.env.core.fragment.CommandFragmentEngine.moveForwardToNextStop(CommandFragmentEngine.java:254)
      at org.eclipse.wst.command.internal.env.ui.widgets.SimpleCommandEngineManager$6.run(SimpleCommandEngineManager.java:294)
      at org.eclipse.jface.operation.ModalContext.runInCurrentThread(ModalContext.java:464)
      at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:372)
      at org.eclipse.jface.wizard.WizardDialog.run(WizardDialog.java:944)
      at org.eclipse.wst.command.internal.env.ui.widgets.SimpleCommandEngineManager.runForwardToNextStop(SimpleCommandEngineManager.java:264)
      at org.eclipse.wst.command.internal.env.ui.widgets.WizardPageManager.runForwardToNextStop(WizardPageManager.java:91)
      at org.eclipse.wst.command.internal.env.ui.widgets.WizardPageManager.getNextPage(WizardPageManager.java:154)
      at org.eclipse.wst.command.internal.env.ui.widgets.SimpleWizardPage.getNextPage(SimpleWizardPage.java:136)
      at org.eclipse.jface.wizard.WizardDialog.nextPressed(WizardDialog.java:823)
      at org.eclipse.jface.wizard.WizardDialog.buttonPressed(WizardDialog.java:369)
      at org.eclipse.jface.dialogs.Dialog$2.widgetSelected(Dialog.java:624)
      at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:228)
      at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
      at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003)
      at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3880)
      at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3473)
      at org.eclipse.jface.window.Window.runEventLoop(Window.java:825)
      at org.eclipse.jface.window.Window.open(Window.java:801)
      at org.eclipse.wst.command.internal.env.ui.widgets.popup.DynamicPopupWizard.run(DynamicPopupWizard.java:130)
      at org.eclipse.ui.internal.PluginAction.runWithEvent(PluginAction.java:251)
      at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:584)
      at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:501)
      at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:411)
      at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
      at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003)
      at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3880)
      at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3473)
      at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2405)
      at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2369)
      at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2221)
      at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:500)
      at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
      at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:493)
      at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
      at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:113)
      at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:194)
      at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
      at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
      at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:368)
      at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      at java.lang.reflect.Method.invoke(Unknown Source)
      at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:559)
      at org.eclipse.equinox.launcher.Main.basicRun(Main.java:514)
      at org.eclipse.equinox.launcher.Main.run(Main.java:1311)
      at org.eclipse.equinox.launcher.Main.main(Main.java:1287)