Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Loading Xtext Resource Into EMF Editor Breaks on Save?
Loading Xtext Resource Into EMF Editor Breaks on Save? [message #1763683] Thu, 18 May 2017 14:38 Go to next message
Brandon Lewis is currently offline Brandon LewisFriend
Messages: 170
Registered: May 2012
Senior Member
I have a simple EMF model in which I have built the standard edit/editor plug-ins and therefore have a basic EMF editor that I can use to edit my EMF model. My EMF model has references to an Xtext DSL I've created. I have validated that all the models talk to one another and that I can create links from the EMF model to the Xtext model and the links are persisted as I want them to be.

I have found, however, that even loading the Xtext resource into the EMF editor is enough to break the editor while the doSave() method is being called. I don't have to have created any links between the models to get this broken behavior. In order to save, I have to close the dirty editor, and only then can I save the file without the following errors.

I can't put my finger on what is happening. All I have to do is load both models into the editor, and if I change anything in the EMF model to trigger a dirty setting, I get the following error:

!ENTRY company.domain..editor 2 0 2017-05-17 15:49:53.066
at dfdft.presentation.dfdftEditor.doSave(
at org.eclipse.ui.internal.DefaultSaveable.doSave(
at org.eclipse.ui.Saveable.doSave(

Followed by a stack overflow inducing chain of these:

at org.eclipse.xtext.validation.impl.ConcreteSyntaxConstraintProvider.containsRelevantElement(
at org.eclipse.xtext.validation.impl.ConcreteSyntaxConstraintProvider.containsRelevantElement(

Each of the models validates on its own and there are no links between them.

Any ideas?

Edit: It is not my current intention to let people edit the Xtext DSL resource using this editor, I am only trying to demonstrated edits of my EMF model (which isn't Xtext).

Is this something to do with serialization of the Xtext model and even if I don't want to edit it, I need to provide some kind of serialization description?

[Updated on: Thu, 18 May 2017 14:42]

Report message to a moderator

Re: Loading Xtext Resource Into EMF Editor Breaks on Save? [message #1763725 is a reply to message #1763683] Fri, 19 May 2017 06:10 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 30813
Registered: July 2009
Senior Member
No, I have no idea. The cause of the invocation target exception isn't shown/available? Certainly the generated editor will try to save all resources in the resource set, and perhaps that's not appropriate in this case for some of the resources...
Re: Loading Xtext Resource Into EMF Editor Breaks on Save? [message #1763769 is a reply to message #1763725] Fri, 19 May 2017 12:34 Go to previous message
Pierre-Charles David is currently offline Pierre-Charles DavidFriend
Messages: 506
Registered: July 2009
Senior Member
I don't know if it's related, but in Sirius we had to explicitly ignore some Xtext-based resources from saving. Specifically, org.eclipse.xtext.common.types.access.TypeResource "throw new UnsupportedOperationException();" on save() (at least in Xtext 2.11).

Pierre-Charles David - Obeo

Need training or professional services for Sirius?
Previous Topic:[CDO] Create ecore model with CDOBlob attribute
Next Topic:XML serialization
Goto Forum:

Current Time: Fri Jan 24 11:58:10 GMT 2020

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

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

Back to the top