Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Xtext: problem in editor when creating a new file
Xtext: problem in editor when creating a new file [message #1414836] Mon, 01 September 2014 12:00 Go to next message
Markus Duft is currently offline Markus DuftFriend
Messages: 148
Registered: February 2013
Senior Member
Hey,

For my DSL when i create a new file (File > New > File) there is a problem with the outline view. It shows "An outline is not available". When i focus /any/ view different than the actual editor, and move focus back into the new editor, i get this:

!ENTRY org.eclipse.ui.workbench 4 2 2014-09-01 13:54:19.677
!MESSAGE Problems occurred when invoking code from plug-in: "org.eclipse.ui.workbench".
!STACK 0
org.eclipse.core.runtime.AssertionFailedException: assertion failed: Label provider instance already in use
	at org.eclipse.core.runtime.Assert.isTrue(Assert.java:110)
	at org.eclipse.jface.viewers.StyledCellLabelProvider.initialize(StyledCellLabelProvider.java:160)
	at org.eclipse.jface.viewers.ColumnViewer.setLabelProvider(ColumnViewer.java:374)
	at org.eclipse.xtext.ui.editor.outline.impl.OutlinePage.configureTree(OutlinePage.java:98)
	at org.eclipse.xtext.ui.editor.outline.impl.OutlinePage.createControl(OutlinePage.java:89)
	at org.eclipse.ui.views.contentoutline.ContentOutline.doCreatePage(ContentOutline.java:137)
	at org.eclipse.ui.part.PageBookView.createPage(PageBookView.java:412)
	at org.eclipse.ui.part.PageBookView.partActivated(PageBookView.java:753)
	at org.eclipse.ui.part.PageBookView$4.partActivated(PageBookView.java:1055)
	at org.eclipse.ui.internal.WorkbenchPage$15.run(WorkbenchPage.java:4790)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
	at org.eclipse.ui.internal.WorkbenchPage.firePartActivated(WorkbenchPage.java:4788)
	at org.eclipse.ui.internal.WorkbenchPage.access$16(WorkbenchPage.java:4768)
	at org.eclipse.ui.internal.WorkbenchPage$E4PartListener.partActivated(WorkbenchPage.java:194)
	at org.eclipse.e4.ui.internal.workbench.PartServiceImpl$2.run(PartServiceImpl.java:183)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
	at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.firePartActivated(PartServiceImpl.java:181)
	at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.activate(PartServiceImpl.java:600)
	at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.activate(PartServiceImpl.java:544)
	at org.eclipse.e4.ui.internal.workbench.swt.AbstractPartRenderer.activate(AbstractPartRenderer.java:104)
	at org.eclipse.e4.ui.workbench.renderers.swt.ContributedPartRenderer$1.handleEvent(ContributedPartRenderer.java:59)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1392)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1416)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1401)
	at org.eclipse.swt.widgets.Shell.setActiveControl(Shell.java:1675)
	at org.eclipse.swt.widgets.Control.gtk_button_press_event(Control.java:3004)
	at org.eclipse.swt.widgets.Control.gtk_button_press_event(Control.java:2940)
	at org.eclipse.swt.widgets.Composite.gtk_button_press_event(Composite.java:706)
	at org.eclipse.swt.widgets.Canvas.gtk_button_press_event(Canvas.java:152)
	at org.eclipse.swt.widgets.Widget.windowProc(Widget.java:2078)
	at org.eclipse.swt.widgets.Control.windowProc(Control.java:5467)
	at org.eclipse.swt.widgets.Display.windowProc(Display.java:4569)
	at org.eclipse.swt.internal.gtk.OS._gtk_main_do_event(Native Method)
	at org.eclipse.swt.internal.gtk.OS.gtk_main_do_event(OS.java:8742)
	at org.eclipse.swt.widgets.Display.eventProc(Display.java:1243)
	at org.eclipse.swt.internal.gtk.OS._g_main_context_iteration(Native Method)
	at org.eclipse.swt.internal.gtk.OS.g_main_context_iteration(OS.java:2288)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3361)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1113)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:997)
	at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:138)
	at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:610)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:567)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:124)
	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:354)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:181)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:606)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:636)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:591)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1450)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1426)


Anybody seen this before? Any hints? I don't feel guilty, but still maybe I did something wrong? Smile

Thanks,
Markus

[Updated on: Mon, 01 September 2014 14:16]

Report message to a moderator

Re: Xtext: problem in editor when creating a new file [message #1414878 is a reply to message #1414836] Mon, 01 September 2014 13:53 Go to previous messageGo to next message
Markus Duft is currently offline Markus DuftFriend
Messages: 148
Registered: February 2013
Senior Member
Interesting: it also happens when i compeltely empty an existing file, and open that in the editor. i get this validation error:

Description	Resource	Path	Location	Type
mismatched input '<EOF>' expecting 'package'	TEST.wdl	/com.wamas.wms.dbal.core/wdl/core	line: 1 /com.wamas.wms.dbal.core/wdl/core/TEST.wdl	WDL Problem


which is expected. But when opening, i first get this (this does not happen when creating the file and eclipse opens the editor for me - only when i manually open an empty file from the package explorer):

java.lang.IllegalStateException: Ambiguous methods [public boolean com.wamas.wdl.ui.outline.WDLOutlineTreeProvider._isLeaf(com.wamas.wdl.wDL.ConnectionRole), public boolean com.wamas.wdl.ui.outline.WDLOutlineTreeProvider._isLeaf(com.wamas.wdl.wDL.Connection), public boolean com.wamas.wdl.ui.outline.WDLOutlineTreeProvider._isLeaf(com.wamas.wdl.wDL.Attribute), public boolean com.wamas.wdl.ui.outline.WDLOutlineTreeProvider._isLeaf(com.wamas.wdl.wDL.Property)] for params [null]
	at org.eclipse.xtext.util.PolymorphicDispatcher.handleAmbigousMethods(PolymorphicDispatcher.java:308)
	at org.eclipse.xtext.util.PolymorphicDispatcher.invoke(PolymorphicDispatcher.java:283)
	at org.eclipse.xtext.ui.editor.outline.impl.DefaultOutlineTreeProvider._createNode(DefaultOutlineTreeProvider.java:123)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:606)
	at org.eclipse.xtext.util.PolymorphicDispatcher.invoke(PolymorphicDispatcher.java:291)
	at org.eclipse.xtext.ui.editor.outline.impl.DefaultOutlineTreeProvider.createNode(DefaultOutlineTreeProvider.java:111)
	at com.wamas.wdl.ui.outline.WDLOutlineTreeProvider._createChildren(WDLOutlineTreeProvider.java:44)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:606)
	at org.eclipse.xtext.util.PolymorphicDispatcher.invoke(PolymorphicDispatcher.java:291)
	at org.eclipse.xtext.ui.editor.outline.impl.DefaultOutlineTreeProvider.createChildren(DefaultOutlineTreeProvider.java:84)
	at org.eclipse.xtext.ui.editor.outline.impl.AbstractOutlineNode$1.process(AbstractOutlineNode.java:98)
	at org.eclipse.xtext.ui.editor.outline.impl.AbstractOutlineNode$1.process(AbstractOutlineNode.java:1)
	at org.eclipse.xtext.util.concurrent.IUnitOfWork$Void.exec(IUnitOfWork.java:36)
	at org.eclipse.xtext.ui.editor.outline.impl.DocumentRootNode$1.exec(DocumentRootNode.java:62)
	at org.eclipse.xtext.ui.editor.outline.impl.DocumentRootNode$1.exec(DocumentRootNode.java:1)
	at org.eclipse.xtext.util.concurrent.AbstractReadWriteAcces.readOnly(AbstractReadWriteAcces.java:62)
	at org.eclipse.xtext.ui.editor.model.XtextDocument$XtextDocumentLocker.readOnly(XtextDocument.java:246)
	at org.eclipse.xtext.ui.editor.model.XtextDocument.readOnly(XtextDocument.java:84)
	at org.eclipse.xtext.ui.editor.outline.impl.DocumentRootNode.readOnly(DocumentRootNode.java:59)
	at org.eclipse.xtext.ui.editor.outline.impl.AbstractOutlineNode.getChildren(AbstractOutlineNode.java:95)
	at org.eclipse.xtext.ui.editor.outline.impl.OutlinePage.addChildren(OutlinePage.java:149)
	at org.eclipse.xtext.ui.editor.outline.impl.OutlinePage.getInitiallyExpandedNodes(OutlinePage.java:139)
	at org.eclipse.xtext.ui.editor.outline.impl.OutlinePage$2.exec(OutlinePage.java:130)
	at org.eclipse.xtext.ui.editor.outline.impl.OutlinePage$2.exec(OutlinePage.java:1)
	at org.eclipse.xtext.util.concurrent.AbstractReadWriteAcces.readOnly(AbstractReadWriteAcces.java:62)
	at org.eclipse.xtext.ui.editor.model.XtextDocument$XtextDocumentLocker.readOnly(XtextDocument.java:246)
	at org.eclipse.xtext.ui.editor.model.XtextDocument.readOnly(XtextDocument.java:84)
	at org.eclipse.xtext.ui.editor.outline.impl.OutlinePage.initializeTreeContent(OutlinePage.java:128)
	at org.eclipse.xtext.ui.editor.outline.impl.OutlinePage.configureTree(OutlinePage.java:119)
	at org.eclipse.xtext.ui.editor.outline.impl.OutlinePage.createControl(OutlinePage.java:89)
	at org.eclipse.ui.views.contentoutline.ContentOutline.doCreatePage(ContentOutline.java:137)
	at org.eclipse.ui.part.PageBookView.createPage(PageBookView.java:412)
	at org.eclipse.ui.part.PageBookView.partActivated(PageBookView.java:753)
	at org.eclipse.ui.views.contentoutline.ContentOutline.partBroughtToTop(ContentOutline.java:212)
	at org.eclipse.ui.part.PageBookView$4.partBroughtToTop(PageBookView.java:1059)
	at org.eclipse.ui.internal.WorkbenchPage$23.run(WorkbenchPage.java:4929)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
	at org.eclipse.ui.internal.WorkbenchPage.firePartBroughtToTop(WorkbenchPage.java:4927)
	at org.eclipse.ui.internal.WorkbenchPage.access$12(WorkbenchPage.java:4912)
	at org.eclipse.ui.internal.WorkbenchPage$E4PartListener.partBroughtToTop(WorkbenchPage.java:199)
	at org.eclipse.e4.ui.internal.workbench.PartServiceImpl$6.run(PartServiceImpl.java:239)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
	at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.firePartBroughtToTop(PartServiceImpl.java:237)
	at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.access$4(PartServiceImpl.java:235)
	at org.eclipse.e4.ui.internal.workbench.PartServiceImpl$1.handleEvent(PartServiceImpl.java:92)
	at org.eclipse.e4.ui.services.internal.events.UIEventHandler$1.run(UIEventHandler.java:41)
	at org.eclipse.swt.widgets.Synchronizer.syncExec(Synchronizer.java:180)
	at org.eclipse.ui.internal.UISynchronizer.syncExec(UISynchronizer.java:150)
	at org.eclipse.swt.widgets.Display.syncExec(Display.java:4491)
	at org.eclipse.e4.ui.internal.workbench.swt.E4Application$1.syncExec(E4Application.java:205)
	at org.eclipse.e4.ui.services.internal.events.UIEventHandler.handleEvent(UIEventHandler.java:38)
	at org.eclipse.equinox.internal.event.EventHandlerWrapper.handleEvent(EventHandlerWrapper.java:197)
	at org.eclipse.equinox.internal.event.EventHandlerTracker.dispatchEvent(EventHandlerTracker.java:197)
	at org.eclipse.equinox.internal.event.EventHandlerTracker.dispatchEvent(EventHandlerTracker.java:1)
	at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
	at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:148)
	at org.eclipse.equinox.internal.event.EventAdminImpl.dispatchEvent(EventAdminImpl.java:135)
	at org.eclipse.equinox.internal.event.EventAdminImpl.sendEvent(EventAdminImpl.java:78)
	at org.eclipse.equinox.internal.event.EventComponent.sendEvent(EventComponent.java:39)
	at org.eclipse.e4.ui.services.internal.events.EventBroker.send(EventBroker.java:80)
	at org.eclipse.e4.ui.internal.workbench.UIEventPublisher.notifyChanged(UIEventPublisher.java:58)
	at org.eclipse.emf.common.notify.impl.BasicNotifierImpl.eNotify(BasicNotifierImpl.java:374)
	at org.eclipse.e4.ui.model.application.ui.impl.ElementContainerImpl.setSelectedElement(ElementContainerImpl.java:171)
	at org.eclipse.e4.ui.internal.workbench.ModelServiceImpl.showElementInWindow(ModelServiceImpl.java:576)
	at org.eclipse.e4.ui.internal.workbench.ModelServiceImpl.bringToTop(ModelServiceImpl.java:543)
	at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.delegateBringToTop(PartServiceImpl.java:610)
	at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.bringToTop(PartServiceImpl.java:322)
	at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.showPart(PartServiceImpl.java:1034)
	at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(WorkbenchPage.java:3112)
	at org.eclipse.ui.internal.WorkbenchPage.access$21(WorkbenchPage.java:3034)
	at org.eclipse.ui.internal.WorkbenchPage$8.run(WorkbenchPage.java:3016)
	at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
	at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:3012)
	at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2976)
	at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2967)
	at org.eclipse.ui.ide.IDE.openEditor(IDE.java:534)
	at org.eclipse.ui.ide.IDE.openEditor(IDE.java:493)
	at org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInEditor(EditorUtility.java:360)
	at org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInEditor(EditorUtility.java:167)
	at org.eclipse.jdt.ui.actions.OpenAction.run(OpenAction.java:268)
	at org.eclipse.jdt.ui.actions.OpenAction.run(OpenAction.java:233)
	at org.eclipse.jdt.ui.actions.SelectionDispatchAction.dispatchRun(SelectionDispatchAction.java:275)
	at org.eclipse.jdt.ui.actions.SelectionDispatchAction.run(SelectionDispatchAction.java:251)
	at org.eclipse.jdt.internal.ui.packageview.PackageExplorerActionGroup.handleOpen(PackageExplorerActionGroup.java:376)
	at org.eclipse.jdt.internal.ui.packageview.PackageExplorerPart$4.open(PackageExplorerPart.java:538)
	at org.eclipse.ui.OpenAndLinkWithEditorHelper$InternalListener.open(OpenAndLinkWithEditorHelper.java:47)
	at org.eclipse.jface.viewers.StructuredViewer$2.run(StructuredViewer.java:866)
	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.fireOpen(StructuredViewer.java:864)
	at org.eclipse.jface.viewers.StructuredViewer.handleOpen(StructuredViewer.java:1152)
	at org.eclipse.jface.viewers.StructuredViewer$6.handleOpen(StructuredViewer.java:1256)
        ....


and after that the above exception. It seems the initial problem is just a follow up from the (opbviously not shown) error...?

the ambigous method call for "null" looks interesting. why call this with null at all? Also this seems to only hit the _isLeaf method of the outline tree provider... i removed all of my specialisations, just in case, and tried again -> empty an existing file -> the outline view keeps without updating, and this is thrown:

Caused by: java.lang.NullPointerException
	at org.eclipse.xtext.ui.editor.outline.impl.DefaultOutlineTreeProvider._isLeaf(DefaultOutlineTreeProvider.java:169)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:606)
	at org.eclipse.xtext.util.PolymorphicDispatcher.invoke(PolymorphicDispatcher.java:291)
	at org.eclipse.xtext.ui.editor.outline.impl.DefaultOutlineTreeProvider._createNode(DefaultOutlineTreeProvider.java:123)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)


open that file from scratch and the same happens, followed by the already in use exception.

[Updated on: Mon, 01 September 2014 14:15]

Report message to a moderator

Re: Xtext: problem in editor when creating a new file [message #1414883 is a reply to message #1414878] Mon, 01 September 2014 14:03 Go to previous message
Markus Duft is currently offline Markus DuftFriend
Messages: 148
Registered: February 2013
Senior Member
ok, seems the real problem was just hidden. i had this method in the outline tree provider:

        def _createChildren(DocumentRootNode rootNode, ModelFragment fragment) {
		createNode(rootNode, fragment.package)
		for (elem : fragment.elements) {
			createNode(rootNode, elem)
		}
	}


which tried to create the package node even for an empty file... Neutral

sorry for the noise, it works now - hope this thread saves somebody some hours in the future Very Happy

[Updated on: Mon, 01 September 2014 14:03]

Report message to a moderator

Previous Topic:Exception in the OutlinePage
Next Topic:Deprecation (Striking out some content) in xtext editor
Goto Forum:
  


Current Time: Sat Apr 20 04:27:58 GMT 2024

Powered by FUDForum. Page generated in 0.02910 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top