With a little side of applesauce...

Thursday, April 8, 2010

Eclipse - startup error caused by read-only file

My instance of Eclipse Galileo was failing to start, but was doing so silently... My only clue was a startup dialogue complaining about a read-only file that was persisting into the new session. To find more information, I ran the following command, which failed silently:
myhost:eclipse speeves$ Eclipse.app/Contents/MacOS/eclipse

which failed silently. Next, I tried this:
myhost:eclipse speeves$ Eclipse.app/Contents/MacOS/eclipse -h
Exception in thread "Thread-3" org.eclipse.swt.SWTException: Device is disposed
at org.eclipse.swt.SWT.error(SWT.java:3884)
at org.eclipse.swt.SWT.error(SWT.java:3799)
at org.eclipse.swt.SWT.error(SWT.java:3770)
at org.eclipse.swt.widgets.Display.error(Display.java:961)
at org.eclipse.swt.widgets.Display.wake(Display.java:4110)
at org.eclipse.ui.application.WorkbenchAdvisor$1.run(WorkbenchAdvisor.java:797)

Ok, so now I have something to work with! This led me to the following post:

Which, in turn, let me to this file:

which stores all of the saved session information for each session. I then removed the 'editor' elements, which referred to an open file from my previous session:

<editor id="org.cfeclipse.cfml.editors.CFMLEditor" name="test.cfm" partName="test.cfm" title="test.cfm" tooltip="/Users/speeves/Documents/workspace/test/test.cfm" workbook="DefaultEditorWorkbook">
<input factoryID="org.eclipse.ui.ide.FileStoreEditorInputFactory" uri="file:/Users/speeves/Documents/test/test.cfm"/>
<editorState selectionHorizontalPixel="0" selectionLength="0" selectionOffset="0" selectionTopPixel="0"/>

And, all of the 'file' elements as well:
<file factoryID="org.eclipse.ui.ide.FileStoreEditorInputFactory" id="org.cfeclipse.cfml.editors.CFMLEditor" name="test.cfm" tooltip="/Users/speeves/Documents/workspace/test/testsp_form.cfm"><persistable uri="file:/Users/speeves/Documents/workspace/test/test.cfm"/></file>

That fixed it!

1 comment:

Shannon Eric Peevey said...

Ok, I have verified that you don't need to delete the file elements from workbench.xml. This problem occurs when I have added a project from a network drive.