Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » No GenPackage for NsURI http://www.eclipse.org/emf/2002/Ecore
No GenPackage for NsURI http://www.eclipse.org/emf/2002/Ecore [message #1771782] Wed, 30 August 2017 11:08 Go to next message
Stefano Valentini is currently offline Stefano ValentiniFriend
Messages: 5
Registered: August 2017
Junior Member
.xtext (as generated by xtext itseft):

JSONModel returns JSONModel:
	{JSONModel}
	'JSONModel'
	'{'
		('rootObject' rootObject=JSONObject)?
	'}';

JSONObject returns JSONObject:
	{JSONObject}
	'JSONObject'
	'{'
		('pairs' '{' pairs+=Pair ( "," pairs+=Pair)* '}' )?
	'}';

Pair returns Pair:
	{Pair}
	'Pair'
	'{'
		('key' key=Key)?
		('value' value=EObject)?
	'}';

Key returns Key:
	{Key}
	'Key'
	name=EString;

EObject returns ecore::EObject:
	{ecore::EObject}
	'EObject'
	;

EString returns ecore::EString:
	STRING | ID;


when I try to build the project it says:
4810 INFO  XtextGenerator     - Generating common infrastructure
4826 ERROR Mwe2Launcher       - Problems running workflow org.xtext.jsonDsl.GenerateJsonDsl: 
[ERROR]: GeneratorException: (Element: -UNKNOWN-; Reported by: XtextGenerator)
	 java.lang.RuntimeException: No GenPackage for NsURI http://www.eclipse.org/emf/2002/Ecore.
	at org.eclipse.xtext.xtext.generator.util.GenModelUtil2.getGenPackage(GenModelUtil2.java:133)
	at org.eclipse.xtext.xtext.generator.model.TypeReference.getQualifiedName(TypeReference.java:235)
	at org.eclipse.xtext.xtext.generator.model.TypeReference.<init>(TypeReference.java:144)
...


but if I remove references to EObject and EObject rule it works (also tried with other languages, whenever I add the following rule I get the error)
EObject returns ecore::EObject:
	{ecore::EObject}
	'EObject'
	;
Re: No GenPackage for NsURI http://www.eclipse.org/emf/2002/Ecore [message #1771784 is a reply to message #1771782] Wed, 30 August 2017 11:22 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 12033
Registered: July 2009
Senior Member
this is likely https://github.com/eclipse/xtext-core/issues/41

Need professional support for Xtext, Xpand, EMF?
Go to: https://xtext.itemis.com
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: No GenPackage for NsURI http://www.eclipse.org/emf/2002/Ecore [message #1771790 is a reply to message #1771784] Wed, 30 August 2017 14:09 Go to previous messageGo to next message
Stefano Valentini is currently offline Stefano ValentiniFriend
Messages: 5
Registered: August 2017
Junior Member
I don't think to fully understand the issue, what should I do? Is there a workaround?
Re: No GenPackage for NsURI http://www.eclipse.org/emf/2002/Ecore [message #1771800 is a reply to message #1771790] Wed, 30 August 2017 15:31 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 12033
Registered: July 2009
Senior Member
you may try to use a old generator/workflow in the xtext 2.8.4 style.

Need professional support for Xtext, Xpand, EMF?
Go to: https://xtext.itemis.com
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: No GenPackage for NsURI http://www.eclipse.org/emf/2002/Ecore [message #1771802 is a reply to message #1771800] Wed, 30 August 2017 15:41 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 12033
Registered: July 2009
Senior Member
can you additionally try

language = StandardLanguage {
referencedResource = "platform:/resource/org.eclipse.emf.ecore/model/Ecore.genmodel"
name = "org.xtext.example.mydsl6.MyDsl"
fileExtensions = "mydsl6"

serializer = {
generateStub = false
}
validator = {
// composedCheck = "org.eclipse.xtext.validation.NamesAreUniqueValidator"
}
}


Need professional support for Xtext, Xpand, EMF?
Go to: https://xtext.itemis.com
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: No GenPackage for NsURI http://www.eclipse.org/emf/2002/Ecore [message #1771804 is a reply to message #1771802] Wed, 30 August 2017 16:00 Go to previous message
Stefano Valentini is currently offline Stefano ValentiniFriend
Messages: 5
Registered: August 2017
Junior Member
adding
referencedResource = "platform:/resource/org.eclipse.emf.ecore/model/Ecore.genmodel"

seems to work.
Thank you all.
Previous Topic:[SOLVED] Type resolver replies null
Next Topic:How To Unit Test Content Assist In Web Project
Goto Forum:
  


Current Time: Wed Jun 20 19:30:24 GMT 2018

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

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

Back to the top