Could not find a GenModel for EPackage ‘http://www.eclipse.org/xtext/common/JavaVMTypes’

If you added

import "http://www.eclipse.org/xtext/common/JavaVMTypes" as jvmTypes

to your DSL and now you get this error:

java.lang.RuntimeException: Could not find a GenModel for EPackage 'http://www.eclipse.org/xtext/common/JavaVMTypes'
If the missing GenModel has been generated via EcoreGeneratorFragment make sure to run it first in the workflow.
If you have a *.genmodel-file, make sure to register it via StandaloneSetup.registerGenModelFile(String)
	at org.eclipse.xtext.generator.GenModelAccess.getGenModelResource(GenModelAccess.java:119)
	at org.eclipse.xtext.generator.ecore.EcoreGeneratorFragment.findEPackagesInGenPackages(EcoreGeneratorFragment.java:347)

then add this line

registerGenModelFile = "platform:/resource/org.eclipse.xtext.common.types/model/JavaVMTypes.genmodel"

to the “bean” block in your MWE2 workflow. It should then look like this:

Workflow {
    bean = StandaloneSetup {
        scanClassPath = true
        platformUri = "${runtimeProject}/.."
		registerGenModelFile = "platform:/resource/org.eclipse.xtext.common.types/model/JavaVMTypes.genmodel"
    }

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s