Bug 185660 - [EditorMgmt] PartInitException when creating new Java project
Summary: [EditorMgmt] PartInitException when creating new Java project
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.3   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Platform UI Triaged CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-05-05 15:49 EDT by Missing name Mising name CLA
Modified: 2019-09-06 15:38 EDT (History)
1 user (show)

See Also:


Attachments
Problem dialogue and empty editor (84.86 KB, image/png)
2007-05-05 15:50 EDT, Missing name Mising name CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Missing name Mising name CLA 2007-05-05 15:49:03 EDT
3.3M7 I20070503-1400

I encountered an error dialogue when creating a new Java project - screenshot to follow.  An empty editor was also opened in the process.  My workspace had projects but they were all closed at the point at which I clicked the 'New Java Project' toolbar icon.  I could cancel the dialogue and continue as normal.  Haven't seen the problem since when creating new projects.

Stack trace: 

org.eclipse.ui.PartInitException: Factory org.eclipse.jdt.ui.ClassFileEditorInputFactory returned null from createElement for editor id=org.eclipse.jdt.ui.ClassFileEditor name=JFrame.class
	at org.eclipse.ui.internal.EditorReference.getRestoredInput(EditorReference.java:363)
	at org.eclipse.ui.internal.EditorReference.getEditorInput(EditorReference.java:324)
	at org.eclipse.ui.internal.EditorReference.createPartHelper(EditorReference.java:597)
	at org.eclipse.ui.internal.EditorReference.createPart(EditorReference.java:426)
	at org.eclipse.ui.internal.WorkbenchPartReference.getPart(WorkbenchPartReference.java:592)
	at org.eclipse.ui.internal.PartPane.setVisible(PartPane.java:299)
	at org.eclipse.ui.internal.presentations.PresentablePart.setVisible(PresentablePart.java:179)
	at org.eclipse.ui.internal.presentations.util.PresentablePartFolder.select(PresentablePartFolder.java:268)
	at org.eclipse.ui.internal.presentations.util.LeftToRightTabOrder.select(LeftToRightTabOrder.java:65)
	at org.eclipse.ui.internal.presentations.util.TabbedStackPresentation.selectPart(TabbedStackPresentation.java:395)
	at org.eclipse.ui.internal.PartStack.refreshPresentationSelection(PartStack.java:1242)
	at org.eclipse.ui.internal.PartStack.handleDeferredEvents(PartStack.java:1210)
	at org.eclipse.ui.internal.LayoutPart.deferUpdates(LayoutPart.java:400)
	at org.eclipse.ui.internal.PartSashContainer.handleDeferredEvents(PartSashContainer.java:1380)
	at org.eclipse.ui.internal.LayoutPart.deferUpdates(LayoutPart.java:400)
	at org.eclipse.ui.internal.WorkbenchPage.handleDeferredEvents(WorkbenchPage.java:1338)
	at org.eclipse.ui.internal.WorkbenchPage.deferUpdates(WorkbenchPage.java:1328)
	at org.eclipse.ui.internal.WorkbenchPage.closeEditors(WorkbenchPage.java:1302)
	at org.eclipse.ui.internal.WorkbenchPage.closeEditor(WorkbenchPage.java:1366)
	at org.eclipse.ui.texteditor.AbstractTextEditor$23.run(AbstractTextEditor.java:4032)
	at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
	at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:123)
	at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3650)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3287)
	at org.eclipse.jface.window.Window.runEventLoop(Window.java:820)
	at org.eclipse.jface.window.Window.open(Window.java:796)
	at org.eclipse.jdt.ui.actions.AbstractOpenWizardAction.run(AbstractOpenWizardAction.java:82)
	at org.eclipse.jdt.internal.ui.wizards.OpenJavaProjectWizardToolbarAction.run(OpenJavaProjectWizardToolbarAction.java:45)
	at org.eclipse.ui.internal.PluginAction.runWithEvent(PluginAction.java:256)
	at org.eclipse.ui.internal.WWinPluginAction.runWithEvent(WWinPluginAction.java:229)
	at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:545)
	at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:490)
	at org.eclipse.jface.action.ActionContributionItem$6.handleEvent(ActionContributionItem.java:443)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:938)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3673)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3284)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2365)
	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2329)
	at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2204)
	at org.eclipse.ui.internal.Workbench$4.run(Workbench.java:466)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:289)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:461)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:106)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:153)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:106)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:76)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:363)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:176)
	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:497)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:436)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1162)

When I then try to close the empty editor I get a very similar stack trace:

org.eclipse.ui.PartInitException: Factory org.eclipse.jdt.ui.ClassFileEditorInputFactory returned null from createElement for editor id=org.eclipse.jdt.ui.ClassFileEditor name=Frame.class
	at org.eclipse.ui.internal.EditorReference.getRestoredInput(EditorReference.java:363)
	at org.eclipse.ui.internal.EditorReference.getEditorInput(EditorReference.java:324)
	at org.eclipse.ui.internal.EditorReference.createPartHelper(EditorReference.java:597)
	at org.eclipse.ui.internal.EditorReference.createPart(EditorReference.java:426)
	at org.eclipse.ui.internal.WorkbenchPartReference.getPart(WorkbenchPartReference.java:592)
	at org.eclipse.ui.internal.PartPane.setVisible(PartPane.java:299)
	at org.eclipse.ui.internal.presentations.PresentablePart.setVisible(PresentablePart.java:179)
	at org.eclipse.ui.internal.presentations.util.PresentablePartFolder.select(PresentablePartFolder.java:268)
	at org.eclipse.ui.internal.presentations.util.LeftToRightTabOrder.select(LeftToRightTabOrder.java:65)
	at org.eclipse.ui.internal.presentations.util.TabbedStackPresentation.selectPart(TabbedStackPresentation.java:395)
	at org.eclipse.ui.internal.PartStack.refreshPresentationSelection(PartStack.java:1242)
	at org.eclipse.ui.internal.PartStack.handleDeferredEvents(PartStack.java:1210)
	at org.eclipse.ui.internal.LayoutPart.deferUpdates(LayoutPart.java:400)
	at org.eclipse.ui.internal.PartSashContainer.handleDeferredEvents(PartSashContainer.java:1380)
	at org.eclipse.ui.internal.LayoutPart.deferUpdates(LayoutPart.java:400)
	at org.eclipse.ui.internal.WorkbenchPage.handleDeferredEvents(WorkbenchPage.java:1338)
	at org.eclipse.ui.internal.WorkbenchPage.deferUpdates(WorkbenchPage.java:1328)
	at org.eclipse.ui.internal.WorkbenchPage.closeEditors(WorkbenchPage.java:1302)
	at org.eclipse.ui.internal.WorkbenchPage.closeEditor(WorkbenchPage.java:1357)
	at org.eclipse.ui.internal.EditorPane.doHide(EditorPane.java:61)
	at org.eclipse.ui.internal.PartStack.close(PartStack.java:542)
	at org.eclipse.ui.internal.EditorStack.close(EditorStack.java:206)
	at org.eclipse.ui.internal.PartStack$1.close(PartStack.java:121)
	at org.eclipse.ui.internal.presentations.util.TabbedStackPresentation$1.handleEvent(TabbedStackPresentation.java:81)
	at org.eclipse.ui.internal.presentations.util.AbstractTabFolder.fireEvent(AbstractTabFolder.java:267)
	at org.eclipse.ui.internal.presentations.util.AbstractTabFolder.fireEvent(AbstractTabFolder.java:276)
	at org.eclipse.ui.internal.presentations.defaultpresentation.DefaultTabFolder.access$1(DefaultTabFolder.java:1)
	at org.eclipse.ui.internal.presentations.defaultpresentation.DefaultTabFolder$1.closeButtonPressed(DefaultTabFolder.java:67)
	at org.eclipse.ui.internal.presentations.PaneFolder.notifyCloseListeners(PaneFolder.java:596)
	at org.eclipse.ui.internal.presentations.PaneFolder$3.close(PaneFolder.java:189)
	at org.eclipse.swt.custom.CTabFolder.onMouse(CTabFolder.java:2149)
	at org.eclipse.swt.custom.CTabFolder$1.handleEvent(CTabFolder.java:320)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:938)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3673)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3284)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2365)
	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2329)
	at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2204)
	at org.eclipse.ui.internal.Workbench$4.run(Workbench.java:466)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:289)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:461)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:106)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:153)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:106)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:76)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:363)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:176)
	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:497)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:436)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1162)

Try a second time and the empty editor closes without complaint.

Curiously, the error log records the following configuration:

eclipse.buildId=I20070323-1616
java.version=1.6.0
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_GB
Framework arguments:  -startup <path_to>\eclipse3.3M6\eclipse\plugins\org.eclipse.equinox.launcher_1.0.0.v20070319.jar
Command-line arguments:  -os win32 -ws win32 -arch x86 -startup <path_to>\eclipse3.3M6\eclipse\plugins\org.eclipse.equinox.launcher_1.0.0.v20070319.jar

i.e. 3.3M6, which I was running separately in parallel - the error was definitely generated by 3.3M7 in the M7 workspace which I launched first and via the desktop icon of a vanilla install (although I had also run and closed 3.3M6 prior to launching M7).  So not sure if this is an actual Eclipse error or if it's a configuration/VM issue making M7 report itself as M6..
Comment 1 Missing name Mising name CLA 2007-05-05 15:50:47 EDT
Created attachment 66012 [details]
Problem dialogue and empty editor
Comment 2 Dani Megert CLA 2007-05-07 03:40:56 EDT
Cannot reproduce using I20070503-1400. Tried combinations of M6 and M7.

Could it be that the lock didn't work and that the same workspace got launched by M6 an M7?

It seems that somehow your install is corruppted as you also filed other bugs that go into that direction (e.g. the code assist bug).
Comment 3 Missing name Mising name CLA 2007-05-07 14:49:00 EDT
Thinking about this I appear to have all projects closed (not in screenshot) but class file editors still open (Clipboard.class is just about visible in the screenshot).  Closing a project usually closes the associated editors.  In this case that isn't happening, so this may be the cause of the problem.  I've tried to get back to this configuration and believe I now have working steps (please verify).  This scenario does not involve the New Java Project dialogue but produces a similar effect:

1. Create new Java project.  Make sure it is the only open project.
2. Open type javax.swing.JFrame.  Hopefully the source will appear.
3. Select 'Frame' on the class declaration line and hit F3 to open java.awt.Frame.
4. Reload workspace: File -> Switch Workspace -> Other -> OK.
5. Close the project.  Both editors will close but an untitled empty editor will be left and an error dialogue will appear.  The stack trace in the log will be similar to that seen in comment 0.

It might be possible to simplify these steps further.

The following seem similar: bug 19023 / bug 20132, bug 170552, bug 26530


On the above questions, it does seem that there's something a little odd about my installation even though I've not configured it in any particular way.  There shouldn't be any problem running two different Eclipse versions simultaneously should there?  The workspace was open in only one Eclipse instance.  One of my projects was using the 3.3M6 SWT jar, however, and the Open Type dialogue shows classes from both the M6 and M7 jars when that project is open.  This probably isn't important, though, as I have been able to reach the above results in a fresh workspace with M7 running alone.  (The configuration information even lists the correct Eclipse version!)

Reopening for comment.
Comment 4 Dani Megert CLA 2007-05-08 06:17:58 EDT
As the input can no longer be created JDT Text correctly returns 'null' when its factory is asked for the editor input (see IElementFactory.createElement(...)). Platform UI then (correctly) wraps this into a PartInitException which it then doesn't handle nicely, similar to bug 185838 and bug 112277.
Comment 5 Boris Bokowski CLA 2008-05-02 14:56:41 EDT
Mass update - removing 3.4 target. This was one of the bugs I marked for investigation (and potential fixing) in 3.4 but I ran out of time. Please ping on the bug if fixing it would be really important for 3.4, and does not require API changes or feature work.
Comment 6 Boris Bokowski CLA 2009-11-17 13:03:33 EST
Remy is now responsible for watching the [EditorMgmt] component area.
Comment 7 Eclipse Webmaster CLA 2019-09-06 15:38:17 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.