Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Using Existing Ecore in XText(Using Existing Ecore in XText)
Using Existing Ecore in XText [message #1396493] Tue, 08 July 2014 11:28 Go to next message
Girish Kumar is currently offline Girish KumarFriend
Messages: 48
Registered: May 2011
Member
Hi All,

I am trying to create the DSL editor.

I have an ecore named coom. Also I have developed graphiti diagram for the same.

Also I have DSL named sysd.

Note : sysd and coom are completely different

Now I want to import coom in my sysd file. So in my sysd.xtext file I added the below line
import "platform:/resource/com.harman.sys.oscar.coom/model/generated/Coom.ecore" as coom

In the workflow i added
registerGenModelFile = "platform:/resource/com.harman.sys.oscar.coom/model/generated/Coom.genmodel"
registerGeneratedEPackage = "com.harman.sys.oscar.coom.CoomPackage"

Then i generated the artifacts with no erros.

When i try to import coom file in sysd. I get xtext validation popup telling
An internal error occurred during: "Xtext validation".
java.lang.IllegalStateException: No IResourceServiceProvider found in registry for uri compB.coom

Also i am able to see some errors in the sysd.ecore which is in src-gen sysd.impl folder. I dont understand why 2 sysd.ecore

org.eclipse.emf.common.util.WrappedException: java.lang.IllegalStateException: No IResourceServiceProvider found in registry for uri compB.coom
at org.eclipse.xtext.linking.lazy.LazyLinkingResource.getEObject(LazyLinkingResource.java:212)
at org.eclipse.xtext.linking.lazy.LazyLinkingResource.doResolveLazyCrossReference(LazyLinkingResource.java:172)
at org.eclipse.xtext.linking.lazy.LazyLinkingResource.resolveLazyCrossReference(LazyLinkingResource.java:131)
at org.eclipse.xtext.linking.lazy.LazyLinkingResource.resolveLazyCrossReferences(LazyLinkingResource.java:117)
at org.eclipse.xtext.EcoreUtil2.resolveLazyCrossReferences(EcoreUtil2.java:513)
at org.eclipse.xtext.validation.ResourceValidatorImpl.resolveProxies(ResourceValidatorImpl.java:155)
at org.eclipse.xtext.validation.ResourceValidatorImpl.validate(ResourceValidatorImpl.java:68)
at org.eclipse.xtext.ui.editor.validation.ValidationJob$1.exec(ValidationJob.java:79)
at org.eclipse.xtext.ui.editor.validation.ValidationJob$1.exec(ValidationJob.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.validation.ValidationJob.createIssues(ValidationJob.java:75)
at org.eclipse.xtext.ui.editor.validation.ValidationJob.run(ValidationJob.java:64)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:53)
Caused by: java.lang.IllegalStateException: No IResourceServiceProvider found in registry for uri compB.coom
at org.eclipse.xtext.scoping.impl.LoadOnDemandResourceDescriptions.getResourceDescription(LoadOnDemandResourceDescriptions.java:70)
at org.eclipse.xtext.scoping.impl.ImportUriGlobalScopeProvider.createLazyResourceScope(ImportUriGlobalScopeProvider.java:170)
at org.eclipse.xtext.scoping.impl.ImportUriGlobalScopeProvider.getScope(ImportUriGlobalScopeProvider.java:80)
at org.eclipse.xtext.scoping.impl.AbstractGlobalScopeProvider.getScope(AbstractGlobalScopeProvider.java:48)
at org.eclipse.xtext.scoping.impl.AbstractGlobalScopeDelegatingScopeProvider.getGlobalScope(AbstractGlobalScopeDelegatingScopeProvider.java:46)
at org.eclipse.xtext.scoping.impl.AbstractGlobalScopeDelegatingScopeProvider.getGlobalScope(AbstractGlobalScopeDelegatingScopeProvider.java:42)
at org.eclipse.xtext.scoping.impl.SimpleLocalScopeProvider.getScope(SimpleLocalScopeProvider.java:60)
at org.eclipse.xtext.scoping.impl.AbstractDeclarativeScopeProvider.delegateGetScope(AbstractDeclarativeScopeProvider.java:72)
at org.eclipse.xtext.scoping.impl.AbstractDeclarativeScopeProvider.getScope(AbstractDeclarativeScopeProvider.java:102)
at org.eclipse.xtext.linking.impl.DefaultLinkingService.getScope(DefaultLinkingService.java:59)
at org.eclipse.xtext.linking.impl.DefaultLinkingService.getLinkedObjects(DefaultLinkingService.java:118)
at org.eclipse.xtext.linking.lazy.LazyLinkingResource.getEObject(LazyLinkingResource.java:228)
at org.eclipse.xtext.linking.lazy.LazyLinkingResource.getEObject(LazyLinkingResource.java:205)
... 14 more
  • Attachment: Error.bmp
    (Size: 5.93MB, Downloaded 130 times)
Re: Using Existing Ecore in XText [message #1396712 is a reply to message #1396493] Tue, 08 July 2014 17:18 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13280
Registered: July 2009
Senior Member
just to be clear: you want to reference stuff that is contained in a non xtext model from a xtextmodel?

Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/xtext/
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Using Existing Ecore in XText [message #1397057 is a reply to message #1396712] Wed, 09 July 2014 06:19 Go to previous messageGo to next message
Girish Kumar is currently offline Girish KumarFriend
Messages: 48
Registered: May 2011
Member
It is non Xtext Model.

But i created a new Dsl for it, still having the same issue.

Steps to reproduce

1. Create a DSL1 of your choice
2. Create a DSL2
3. import DSL1 in DSl2.xtext
4. try to reference any class of DSl1 in DSl2
5. Generate the workflow DSL2
6. you can see DSL2.ecore in the src-gen/com...impl

I am using xtext 2.6 and eclipse Juno

let me know, this is the known issue.


What i mean is below tutorial does not work

http://christiandietrich.wordpress.com/2012/08/07/xtext-referencing-elements-of-one-dsl-from-another-dsl/

[Updated on: Wed, 09 July 2014 06:52]

Report message to a moderator

Re: Using Existing Ecore in XText [message #1397139 is a reply to message #1397057] Wed, 09 July 2014 08:56 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13280
Registered: July 2009
Senior Member
I Still cannot reproduce that

grammar org.xtext.example.mydsl.MyDslA with org.eclipse.xtext.common.Terminals

generate myDslA "http://www.xtext.org/example/mydsl/MyDslA"

Model:
	elements+=AElement*;
	
AElement:
	'aelement' name=ID;


grammar org.xtext.example.mydsl.MyDslB with org.eclipse.xtext.common.Terminals

import "http://www.xtext.org/example/mydsl/MyDslA" as a
generate myDslB "http://www.xtext.org/example/mydsl/MyDslB"

Model:
	elements+=BElement*;
	
BElement:
	'belement' name=ID 'to' a=[a::AElement];


module org.xtext.example.mydsl.GenerateMyDslB

import org.eclipse.emf.mwe.utils.*
import org.eclipse.xtext.generator.*
import org.eclipse.xtext.ui.generator.*

var grammarURI = "classpath:/org/xtext/example/mydsl/MyDslB.xtext"
var fileExtensions = "mydslb"
var projectName = "org.xtext.example.mydslb"
var runtimeProject = "../${projectName}"
var generateXtendStub = true
var encoding = "UTF-8"

Workflow {
    bean = StandaloneSetup {
    	scanClassPath = true
    	platformUri = "${runtimeProject}/.."
    	// The following two lines can be removed, if Xbase is not used.
    	registerGeneratedEPackage = "org.xtext.example.mydsl.myDslA.MyDslAPackage"
    	registerGenModelFile = "platform:/resource/org.xtext.example.mydsla/model/generated/MyDslA.genmodel"
    }
....


Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/xtext/
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Using Existing Ecore in XText [message #1400577 is a reply to message #1397139] Mon, 14 July 2014 12:10 Go to previous messageGo to next message
Girish Kumar is currently offline Girish KumarFriend
Messages: 48
Registered: May 2011
Member
Hi Christian,

The example which you have mentioned works fine. but the issue is if the Grammer in DSl2 increases, it simply complains. I guess the problem is with generator.

please refer the example which i have ....

https://www.dropbox.com/s/bb5s58t5cummu05/WS2.zip

sysd and coom are my dsl's

1. In Sysd file remove all the Grammer related to Component, State and System (Also remove coom import),Generate, it works perfect
2. Now Keep only Component, State and System and remove everything, generate it works
3. But the Grammer that i have shared does not have any error, no java compile errors but generated two sysd.ecore file . one in model/generated/sysd.ecore and src-gen/com....impl/sysd.ecore(This file is having some reference issues)

Can you please look in to it.. I guess this is xtext bug.

Regards
Girish
Re: Using Existing Ecore in XText [message #1400742 is a reply to message #1400577] Mon, 14 July 2014 16:54 Go to previous message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13280
Registered: July 2009
Senior Member
this is definitively a bug in xtext. please file a bugzilla

Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/xtext/
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Previous Topic:Error after Xtext Utils add
Next Topic:Integer-based qualified IDs
Goto Forum:
  


Current Time: Mon Dec 16 13:53:47 GMT 2019

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

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

Back to the top