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

Bug 101337

Summary: WSDL in Java Project causes NPE in Web service Client wizard
Product: [WebTools] WTP Webservices Reporter: Kelvin Cheung <kelvinhc>
Component: jst.wsAssignee: Rupam Kuehner <rsinha>
Status: CLOSED FIXED QA Contact:
Severity: critical    
Priority: P1 CC: cbrealey, yenlu
Version: 0.7   
Target Milestone: 1.0 M6   
Hardware: PC   
OS: Windows 2000   
Whiteboard:
Attachments:
Description Flags
apply to org.eclipse.jst.ws.consumption.ui
none
apply to org.eclipse.jst.ws.creation.ui none

Description Kelvin Cheung CLA 2005-06-22 15:45:07 EDT
If I put a WSDL file in an EJB project, by selecing either "Top down EJB Web 
Service" or "Top down Java bean Web Service", and then clicking next on page 2 
(Object selectiong), causes an NPE.  WSDL file in Web project would not cause 
any problem.

IWAB0234E An internal error occurred. Details: null
    java.lang.NullPointerException
    at 
org.eclipse.wst.common.componentcore.internal.resources.VirtualComponent.getComp
onentTypeId(VirtualComponent.java:78)
    at org.eclipse.jst.ws.internal.common.J2EEUtils.isWebComponent
(J2EEUtils.java:1825)
    at org.eclipse.jst.ws.internal.common.J2EEUtils.isWebComponent
(J2EEUtils.java:1821)
    at 
org.eclipse.jst.ws.internal.consumption.ui.widgets.runtime.ClientRuntimeSelectio
nWidgetDefaultingCommand.getClientRuntimeAndJ2EEFromProject
(ClientRuntimeSelectionWidgetDefaultingCommand.java:418)
    at 
org.eclipse.jst.ws.internal.consumption.ui.widgets.runtime.ClientRuntimeSelectio
nWidgetDefaultingCommand.execute
(ClientRuntimeSelectionWidgetDefaultingCommand.java:196)
    at 
org.eclipse.jst.ws.internal.creation.ui.widgets.runtime.ServerRuntimeSelectionWi
dgetDefaultingCommand.execute
(ServerRuntimeSelectionWidgetDefaultingCommand.java:77)
    at 
org.eclipse.wst.command.internal.env.core.fragment.CommandFragmentEngine.runComm
and(CommandFragmentEngine.java:335)
    at 
org.eclipse.wst.command.internal.env.core.fragment.CommandFragmentEngine.visitTo
p(CommandFragmentEngine.java:301)
    at 
org.eclipse.wst.command.internal.env.core.fragment.CommandFragmentEngine.moveFor
wardToNextStop(CommandFragmentEngine.java:217)
    at 
org.eclipse.wst.command.internal.env.ui.widgets.SimpleCommandEngineManager$4.run
(SimpleCommandEngineManager.java:208)
    at org.eclipse.jface.operation.ModalContext.runInCurrentThread
(ModalContext.java:346)
    at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:291)
    at org.eclipse.jface.wizard.WizardDialog.run(WizardDialog.java:830)
    at 
org.eclipse.wst.command.internal.env.ui.widgets.SimpleCommandEngineManager.runFo
rwardToNextStop(SimpleCommandEngineManager.java:177)
    at 
org.eclipse.wst.command.internal.env.ui.widgets.WizardPageManager.runForwardToNe
xtStop(WizardPageManager.java:80)
    at 
org.eclipse.wst.command.internal.env.ui.widgets.WizardPageManager.getNextPage
(WizardPageManager.java:119)
    at 
org.eclipse.wst.command.internal.env.ui.widgets.SimpleWizardPage.getNextPage
(SimpleWizardPage.java:120)
    at org.eclipse.jface.wizard.WizardDialog.nextPressed(WizardDialog.java:747)
    at org.eclipse.jface.wizard.WizardDialog.buttonPressed
(WizardDialog.java:345)
    at org.eclipse.jface.dialogs.Dialog$2.widgetSelected(Dialog.java:556)
    at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:89)
    at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:844)
    at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3058)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2691)
    at org.eclipse.jface.window.Window.runEventLoop(Window.java:809)
    at org.eclipse.jface.window.Window.open(Window.java:787)
    at org.eclipse.ui.actions.NewWizardAction.run(NewWizardAction.java:181)
    at org.eclipse.jface.action.Action.runWithEvent(Action.java:996)
    at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection
(ActionContributionItem.java:538)
    at org.eclipse.jface.action.ActionContributionItem.access$2
(ActionContributionItem.java:488)
    at org.eclipse.jface.action.ActionContributionItem$5.handleEvent
(ActionContributionItem.java:400)
    at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:844)
    at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3058)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2691)
    at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1716)
    at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1680)
    at org.eclipse.ui.internal.Workbench.createAndRunWorkbench
(Workbench.java:365)
    at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:143)
    at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:103)
    at org.eclipse.core.internal.runtime.PlatformActivator$1.run
(PlatformActivator.java:226)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run
(EclipseStarter.java:376)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run
(EclipseStarter.java:163)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke
(NativeMethodAccessorImpl.java:85)
    at sun.reflect.NativeMethodAccessorImpl.invoke
(NativeMethodAccessorImpl.java:58)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke
(DelegatingMethodAccessorImpl.java:60)
    at java.lang.reflect.Method.invoke(Method.java:391)
    at org.eclipse.core.launcher.Main.invokeFramework(Main.java:334)
    at org.eclipse.core.launcher.Main.basicRun(Main.java:278)
    at org.eclipse.core.launcher.Main.run(Main.java:973)
    at org.eclipse.core.launcher.Main.main(Main.java:948)
Comment 1 Rupam Kuehner CLA 2005-06-22 16:22:51 EDT
Targeting for M6. Kelvin/Chris, let me know if you disagree.
Comment 2 Rupam Kuehner CLA 2005-07-08 11:34:46 EDT
I can't reproduce this on recent drivers.
Comment 3 Todd Lindner CLA 2005-07-08 11:46:25 EDT
(In reply to comment #2)
> I can't reproduce this on recent drivers.

In eclipse 3.1 (final) using WTP M5, if I right click on a WSDL file, click Web
Service -> Generate Client.  Select Java Proxy, click next twice, I get a very
similar error still.

IWAB0234E An internal error occurred. Details: null
    java.lang.NullPointerException
    at
org.eclipse.wst.common.componentcore.internal.resources.VirtualComponent.getComponentTypeId(VirtualComponent.java:90)
    at
org.eclipse.jst.ws.internal.common.J2EEUtils.isWebComponent(J2EEUtils.java:1825)
    at
org.eclipse.jst.ws.internal.common.J2EEUtils.isWebComponent(J2EEUtils.java:1821)
    at
org.eclipse.jst.ws.internal.consumption.ui.widgets.runtime.ClientRuntimeSelectionWidgetDefaultingCommand.getClientRuntimeAndJ2EEFromProject(ClientRuntimeSelectionWidgetDefaultingCommand.java:415)
    at
org.eclipse.jst.ws.internal.consumption.ui.widgets.runtime.ClientRuntimeSelectionWidgetDefaultingCommand.execute(ClientRuntimeSelectionWidgetDefaultingCommand.java:194)
    at
org.eclipse.wst.command.internal.env.core.fragment.CommandFragmentEngine.runCommand(CommandFragmentEngine.java:335)
    at
org.eclipse.wst.command.internal.env.core.fragment.CommandFragmentEngine.visitTop(CommandFragmentEngine.java:301)
    at
org.eclipse.wst.command.internal.env.core.fragment.CommandFragmentEngine.moveForwardToNextStop(CommandFragmentEngine.java:217)
    at
org.eclipse.wst.command.internal.env.ui.widgets.SimpleCommandEngineManager$4.run(SimpleCommandEngineManager.java:208)
    at
org.eclipse.jface.operation.ModalContext.runInCurrentThread(ModalContext.java:346)
    at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:291)
    at org.eclipse.jface.wizard.WizardDialog.run(WizardDialog.java:830)
    at
org.eclipse.wst.command.internal.env.ui.widgets.SimpleCommandEngineManager.runForwardToNextStop(SimpleCommandEngineManager.java:177)
    at
org.eclipse.wst.command.internal.env.ui.widgets.WizardPageManager.runForwardToNextStop(WizardPageManager.java:80)
    at
org.eclipse.wst.command.internal.env.ui.widgets.WizardPageManager.getNextPage(WizardPageManager.java:119)
    at
org.eclipse.wst.command.internal.env.ui.widgets.SimpleWizardPage.getNextPage(SimpleWizardPage.java:120)
    at org.eclipse.jface.wizard.WizardDialog.nextPressed(WizardDialog.java:747)
    at org.eclipse.jface.wizard.WizardDialog.buttonPressed(WizardDialog.java:345)
    at org.eclipse.jface.dialogs.Dialog$2.widgetSelected(Dialog.java:556)
    at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:90)
    at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:843)
    at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3080)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2713)
    at org.eclipse.jface.window.Window.runEventLoop(Window.java:809)
    at org.eclipse.jface.window.Window.open(Window.java:787)
    at
org.eclipse.wst.command.internal.env.ui.widgets.popup.DynamicPopupWizard.run(DynamicPopupWizard.java:129)
    at org.eclipse.ui.internal.PluginAction.runWithEvent(PluginAction.java:246)
    at
org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:538)
    at
org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:488)
    at
org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:400)
    at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:843)
    at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3080)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2713)
    at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1699)
    at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1663)
    at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:367)
    at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:143)
    at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:103)
    at
org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:226)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:376)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:163)
    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.core.launcher.Main.invokeFramework(Main.java:334)
    at org.eclipse.core.launcher.Main.basicRun(Main.java:278)
    at org.eclipse.core.launcher.Main.run(Main.java:973)
    at org.eclipse.core.launcher.Main.main(Main.java:948)
Comment 4 Rupam Kuehner CLA 2005-07-08 12:02:41 EDT
Todd,

I'm using the M5 driver and don't see this. Could you please provide a few more 
details such as:

1. What type of project is the WSDL in?
2. What is the server target of the project?
3. Where, in the folder structure of the project, is the WSDL located
4. Please attach the WSDL to the bug.

Thanks.
Comment 5 Rupam Kuehner CLA 2005-07-08 12:07:17 EDT
Reopening since a problem is still being observed.
Comment 6 Todd Lindner CLA 2005-07-08 12:10:29 EDT
Ahh.. ok it works fine if I run in a Web Project.  I had been testing in a Java
Project.  This is probably the wrong forum, but I really dont understand why if
all i'm doing is trying to call some Web Services from some straight Java code
(main() invocation), why does WST want me to run it in a Web Project, and have a
server defined???
Comment 7 Rupam Kuehner CLA 2005-07-08 17:16:08 EDT
I've opened an enhancement (103221) for allowing generation of Axis Web service 
clients in Java projects and, in that case, allowing the user to proceed 
without any configured servers. I don't think we can do this in the WTP 0.7 
time-frame but we can try for WTP 1.0.

That said, we need to handle this more gracefully in 0.7 since it's probably 
something many users will run into. I will fix the NullPointerException so that 
the user can proceed past page 2, assuming they have a tomcat server 
configured. The Web projetct will be created for the user automatically and the 
Web service client code will be generated into the Web project. If they don't 
have servers configured, an error dialog will appear telling the user to go to 
the preferences and configure an appropriate server.
Comment 8 Rupam Kuehner CLA 2005-07-11 21:01:25 EDT
Created attachment 24585 [details]
apply to org.eclipse.jst.ws.consumption.ui

patch 1 of 2
Comment 9 Rupam Kuehner CLA 2005-07-11 21:02:12 EDT
Created attachment 24586 [details]
apply to org.eclipse.jst.ws.creation.ui

patch 2 of 2
Comment 10 Rupam Kuehner CLA 2005-07-11 21:02:50 EDT
The attached patches are ready to be committed.
Comment 11 Chris Brealey CLA 2005-07-12 12:21:16 EDT
Thanks - Patches committed. I'll release later today.
Comment 12 Chris Brealey CLA 2005-07-12 15:32:54 EDT
Changes released as v20050712_1530.
Comment 13 Kelvin Cheung CLA 2005-07-18 16:32:12 EDT
Verified in WTP 0.7 RC1
Comment 14 Rupam Kuehner CLA 2005-07-18 17:06:53 EDT
Closing