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

Bug 336472

Summary: Opening virgin HTML file in web page editor and then clicking File -> Properties with file highlighted in navigator consistently triggers exception.
Product: [WebTools] Java Server Faces Reporter: Ladar Levison <ladar>
Component: UIAssignee: Ian Trimble <ian.trimble>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: raghunathan.srinivasan, thatnitind
Version: unspecified   
Target Milestone: 3.3 M7   
Hardware: PC   
OS: Linux   
Whiteboard:
Attachments:
Description Flags
Video showing steps to trigger bug.
none
Error log generated during the video capture. none

Description Ladar Levison CLA 2011-02-07 02:49:54 EST
I just spent far too much of Super Bowl Sunday investigating exceptions originating in the jface plugin. I originally thought they might indicate a key component of my Eclipse installation wasn't upgraded correctly. But it turns out the cause is a legitimate bug. It seems that when I click File -> Properties I get exceptions if a file isn't actively selected. That means I can still have a file like lavabit.html open in an editor, but if I click an event in the error log, and then click File -> Properties I will trigger the exception. I've managed to trigger the issue by clicking in the navigator view, etc but wasn't able to figure out how to reproduce that scenario consistently. Sometimes the modal would correctly display the properties of the file selected in the navigator and other times it would trigger the exception. However it does appear that in all the cases I was able to stumble across the underlying issue is that Eclipse doesn't know which file to display properties for so a generic properties modal is shown displaying rather confusing error messages in the place of properties. 

I'm assuming this behaviour was not intended. Presumably if File -> Properties is not disabled it will work. And if it works it should be able to find out the file based on a selection inside a navigator view, or if necessary by using the most recently selected open file editor tab. 


-- Error Details --
Date: Mon Feb 07 01:24:21 CST 2011
Message: Problems occurred when invoking code from plug-in: "org.eclipse.jface".
Severity: Error
Product: Eclipse 1.3.1.20100913-1228 (org.eclipse.epp.package.cpp.product)
Plugin: org.eclipse.jface
Session Data:
eclipse.buildId=M20100909-0800
java.version=1.6.0_22
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=en_US
Framework arguments:  -product org.eclipse.epp.package.linuxtools.product -product org.eclipse.epp.package.cpp.product
Command-line arguments:  -os linux -ws gtk -arch x86_64 -product org.eclipse.epp.package.linuxtools.product -product org.eclipse.epp.package.cpp.product -data /home/ladar/Lavabit/


Exception Stack Trace:
java.lang.NullPointerException: element not initialized.
at org.eclipse.cdt.ui.newui.AbstractPage.getElement(AbstractPage.java:1230)
at org.eclipse.cdt.ui.newui.AbstractPage.getProject(AbstractPage.java:384)
at org.eclipse.cdt.ui.newui.AbstractPage.populateConfigurations(AbstractPage.java:719)
at org.eclipse.cdt.ui.newui.AbstractPage.setVisible(AbstractPage.java:799)
at org.eclipse.jface.preference.PreferenceDialog.showPage(PreferenceDialog.java:1323)
at org.eclipse.ui.internal.dialogs.FilteredPreferenceDialog.showPage(FilteredPreferenceDialog.java:673)
at org.eclipse.jface.preference.PreferenceDialog$10.run(PreferenceDialog.java:708)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
at org.eclipse.jface.preference.PreferenceDialog$9.selectionChanged(PreferenceDialog.java:704)
at org.eclipse.jface.viewers.StructuredViewer$3.run(StructuredViewer.java:867)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:49)
at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:175)
at org.eclipse.jface.viewers.StructuredViewer.firePostSelectionChanged(StructuredViewer.java:865)
at org.eclipse.jface.viewers.StructuredViewer.setSelection(StructuredViewer.java:1700)
at org.eclipse.jface.viewers.TreeViewer.setSelection(TreeViewer.java:1139)
at org.eclipse.jface.preference.PreferenceDialog.selectSavedItem(PreferenceDialog.java:1054)
at org.eclipse.ui.internal.dialogs.FilteredPreferenceDialog.selectSavedItem(FilteredPreferenceDialog.java:728)
at org.eclipse.jface.preference.PreferenceDialog$4.run(PreferenceDialog.java:375)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
at org.eclipse.jface.preference.PreferenceDialog.createContents(PreferenceDialog.java:371)
at org.eclipse.jface.window.Window.create(Window.java:431)
at org.eclipse.jface.dialogs.Dialog.create(Dialog.java:1089)
at org.eclipse.ui.internal.dialogs.PropertyDialog.createDialogOn(PropertyDialog.java:82)
at org.eclipse.ui.internal.handlers.PropertyDialogHandler.execute(PropertyDialogHandler.java:53)
at org.eclipse.ui.internal.handlers.HandlerProxy.execute(HandlerProxy.java:293)
at org.eclipse.core.commands.Command.executeWithChecks(Command.java:476)
at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:508)
at org.eclipse.ui.internal.handlers.HandlerService.executeCommand(HandlerService.java:169)
at org.eclipse.ui.internal.handlers.SlaveHandlerService.executeCommand(SlaveHandlerService.java:241)
at org.eclipse.ui.menus.CommandContributionItem.handleWidgetSelection(CommandContributionItem.java:820)
at org.eclipse.ui.menus.CommandContributionItem.access$19(CommandContributionItem.java:806)
at org.eclipse.ui.menus.CommandContributionItem$5.handleEvent(CommandContributionItem.java:796)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1258)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3540)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3161)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2640)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2604)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2438)
at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:671)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:664)
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:196)
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(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:619)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:574)
at org.eclipse.equinox.launcher.Main.run(Main.java:1407)
at org.eclipse.equinox.launcher.Main.main(Main.java:1383)
Comment 1 Ladar Levison CLA 2011-02-07 03:09:52 EST
Created attachment 188422 [details]
Video showing steps to trigger bug.

Short video clip showing bug trigger steps. Stored inside rar file to keep it under 2 megabyte limit.
Comment 2 Ladar Levison CLA 2011-02-07 03:11:08 EST
Created attachment 188424 [details]
Error log generated during the video capture.

Error log generated during the video capture.
Comment 3 Nitin Dahyabhai CLA 2011-02-07 20:30:31 EST
I just get a "No property pages for Error" popup without CDT installed.  Since the exception is thrown from org.eclipse.cdt.ui.newui.AbstractPage#getElement(), maybe it belongs there?
Comment 4 Ladar Levison CLA 2011-02-07 20:43:14 EST
Sounds like when the web editor isn't activated the request is routed to the CDT classes. I'm typically working in C although this particular file was in a generic project. 

Since I have the WTP plugins installed shouldn't the request be routed there, or failing that, the common properties to all files displayed by CDT?
Comment 5 Raghunathan Srinivasan CLA 2011-03-28 13:51:46 EDT
For review.
Comment 6 Ian Trimble CLA 2011-03-30 15:52:40 EDT
Fix submitted at 2011/03/30 12:47PM PDT.

Note that when you select an object in the UI (such as an entry in the error log view) and request properties, you will get properties for that object, and not something else in a different view (such as a file in an editor). This is not specific to JSF Tools or WTP, try the same with a Java file in the JDT editor.

Also, there may well still be an issue with CDT not correctly handling the case when there are no known property pages for a specific object - typically, you simply get a message box that informs you as much, and not a stacktrace. I'm afraid I don't have the time to debug CDT.

The issue as logged is resolved.