Skip to main content



      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 07:08 Go to next message
Eclipse UserFriend
.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 07:22 Go to previous messageGo to next message
Eclipse UserFriend
this is likely https://github.com/eclipse/xtext-core/issues/41
Re: No GenPackage for NsURI http://www.eclipse.org/emf/2002/Ecore [message #1771790 is a reply to message #1771784] Wed, 30 August 2017 10:09 Go to previous messageGo to next message
Eclipse UserFriend
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 11:31 Go to previous messageGo to next message
Eclipse UserFriend
you may try to use a old generator/workflow in the xtext 2.8.4 style.
Re: No GenPackage for NsURI http://www.eclipse.org/emf/2002/Ecore [message #1771802 is a reply to message #1771800] Wed, 30 August 2017 11:41 Go to previous messageGo to next message
Eclipse UserFriend
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"
}
}
Re: No GenPackage for NsURI http://www.eclipse.org/emf/2002/Ecore [message #1771804 is a reply to message #1771802] Wed, 30 August 2017 12:00 Go to previous message
Eclipse UserFriend
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: Mon Jul 14 13:22:05 EDT 2025

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

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

Back to the top