This Bugzilla instance is deprecated, and most Eclipse projects now use GitHub or Eclipse GitLab. Please see the deprecation plan for details.
Bug 304867 - WPE fails to open (throws NPE)
Summary: WPE fails to open (throws NPE)
Status: CLOSED FIXED
Alias: None
Product: WTP Source Editing
Classification: WebTools
Component: wst.sse (show other bugs)
Version: 3.2   Edit
Hardware: PC Windows XP
: P3 major (vote)
Target Milestone: 3.2 M6   Edit
Assignee: Nick Sandonato CLA
QA Contact: Nitin Dahyabhai CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-03-05 14:24 EST by Debajit Adhikary CLA
Modified: 2010-03-06 13:41 EST (History)
2 users (show)

See Also:


Attachments
patch (1.29 KB, patch)
2010-03-05 15:34 EST, Nick Sandonato CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Debajit Adhikary CLA 2010-03-05 14:24:00 EST
Build Identifier: I20100302-0800

The Web Page Editor fails to open.

Reproducible: Always

Steps to Reproduce:
1. Create a new Dynamic Web Project with the JSF facet
2. Create a new JSP file (say "index.jsp") in WebContent/
3. Right-click on index.jsp and select Open With > Web Page Editor

Expected Results:
Web Page Editor should open.

Actual Results:
Web Page Editor fails to open. The following message is seen:

"Could not open the editor: An unexpected exception was thrown."

Stacktrace:

java.lang.NullPointerException
   at org.eclipse.wst.sse.ui.StructuredTextEditor.createPartControl(StructuredTextEditor.java:1482)
   at org.eclipse.jst.pagedesigner.ui.common.sash.SashEditorPart.addPage(SashEditorPart.java:110)
   at org.eclipse.jst.pagedesigner.editors.HTMLEditor$3.createPages(HTMLEditor.java:265)
   at org.eclipse.jst.pagedesigner.ui.common.sash.SashEditorPart.createPartControl(SashEditorPart.java:190)
   at org.eclipse.ui.part.MultiPageEditorPart.addPage(MultiPageEditorPart.java:242)
   at org.eclipse.ui.part.MultiPageEditorPart.addPage(MultiPageEditorPart.java:212)
   at org.eclipse.jst.pagedesigner.editors.HTMLEditor.sash_createAndAddDesignSourcePage(HTMLEditor.java:268)
   at org.eclipse.jst.pagedesigner.editors.HTMLEditor.createPages(HTMLEditor.java:439)
   at org.eclipse.ui.part.MultiPageEditorPart.createPartControl(MultiPageEditorPart.java:357)
   at org.eclipse.ui.internal.EditorReference.createPartHelper(EditorReference.java:662)
   at org.eclipse.ui.internal.EditorReference.createPart(EditorReference.java:462)
   at org.eclipse.ui.internal.WorkbenchPartReference.getPart(WorkbenchPartReference.java:595)
   at org.eclipse.ui.internal.PartPane.setVisible(PartPane.java:313)
   at org.eclipse.ui.internal.presentations.PresentablePart.setVisible(PresentablePart.java:180)
   at org.eclipse.ui.internal.presentations.util.PresentablePartFolder.select(PresentablePartFolder.java:270)
   at org.eclipse.ui.internal.presentations.util.LeftToRightTabOrder.select(LeftToRightTabOrder.java:65)
   at org.eclipse.ui.internal.presentations.util.TabbedStackPresentation.selectPart(TabbedStackPresentation.java:473)
   at org.eclipse.ui.internal.PartStack.refreshPresentationSelection(PartStack.java:1254)
   at org.eclipse.ui.internal.PartStack.setSelection(PartStack.java:1207)
   at org.eclipse.ui.internal.PartStack.showPart(PartStack.java:1606)
   at org.eclipse.ui.internal.PartStack.add(PartStack.java:497)
   at org.eclipse.ui.internal.EditorStack.add(EditorStack.java:103)
   at org.eclipse.ui.internal.PartStack.add(PartStack.java:483)
   at org.eclipse.ui.internal.EditorStack.add(EditorStack.java:112)
   at org.eclipse.ui.internal.EditorSashContainer.addEditor(EditorSashContainer.java:63)
   at org.eclipse.ui.internal.EditorAreaHelper.addToLayout(EditorAreaHelper.java:225)
   at org.eclipse.ui.internal.EditorAreaHelper.addEditor(EditorAreaHelper.java:213)
   at org.eclipse.ui.internal.EditorManager.createEditorTab(EditorManager.java:778)
   at org.eclipse.ui.internal.EditorManager.openEditorFromDescriptor(EditorManager.java:677)
   at org.eclipse.ui.internal.EditorManager.openEditor(EditorManager.java:638)
   at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditorBatched(WorkbenchPage.java:2860)
   at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(WorkbenchPage.java:2768)
   at org.eclipse.ui.internal.WorkbenchPage.access$11(WorkbenchPage.java:2760)
   at org.eclipse.ui.internal.WorkbenchPage$10.run(WorkbenchPage.java:2711)
   at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
   at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2707)
   at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2691)
   at org.eclipse.ui.actions.OpenWithMenu.openEditor(OpenWithMenu.java:344)
   at org.eclipse.ui.actions.OpenWithMenu$2.handleEvent(OpenWithMenu.java:192)
   at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
   at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1050)
   at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4014)
   at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3605)
   at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2408)
   at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2372)
   at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2221)
   at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:501)
   at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
   at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:494)
   at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
   at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:115)
   at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:195)
   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:369)
   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:611)
   at org.eclipse.equinox.launcher.Main.basicRun(Main.java:566)
   at org.eclipse.equinox.launcher.Main.run(Main.java:1363)
Comment 1 Gerry Kessler CLA 2010-03-05 15:02:17 EST
This issue is due to a change made to StructuredTextEditor rev.1.118 on 3/3/10.   

Minimally a null check is required for fOutlineHandler at line 1482.  fOutlineHandler is created at line 1371 if there is a handlerService.  

WPE is apparently not providing an IHandlerService at this time.   This is now being tracked with Bug 304874.
Comment 2 Nick Sandonato CLA 2010-03-05 15:34:02 EST
Created attachment 161187 [details]
patch
Comment 3 Nick Sandonato CLA 2010-03-05 15:51:17 EST
Released the null check and requested a respin on wtp-releng.
Comment 4 Raghunathan Srinivasan CLA 2010-03-06 13:41:16 EST
Verified in build I-3.2.0-20100305211931