I must have checked and double checked my configuration about 50 times to match http://www.eclipse.org/Xtext/documentation/2_0_0/199-xtext-and-java.php#Xbase_3
But still the xbase import cannot be resolved.
I am using xtext 2.2.1.
I don't know what I am doing incorrectly. Below are excerpts from my mwe2, manifest, dsl files.
From my mwe2 file:
bean = StandaloneSetup {
scanClassPath = true
platformUri = "${runtimeProject}/.."
registerGenModelFile =
"platform:/resource/org.eclipse.xtext.xbase/model/Xbase.genmodel"
}
....
// provides the necessary bindings for java types integration
fragment = types.TypesGeneratorFragment {}
// generates the required bindings only if the grammar inherits from Xbase
fragment = xbase.XbaseGeneratorFragment {}
My manifest file:
Require-Bundle: org.eclipse.xtext;bundle-version="2.2.0";visibility:=reexport,
org.apache.log4j;bundle-version="1.2.15";visibility:=reexport,
org.apache.commons.logging;bundle-version="1.0.4";resolution:=optional;visibility:=reexport,
org.eclipse.xtext.generator;bundle-version="2.2.0";resolution:=optional,
org.eclipse.emf.codegen.ecore;resolution:=optional,
org.eclipse.emf.mwe.utils;resolution:=optional,
org.eclipse.emf.mwe2.launch;resolution:=optional,
org.eclipse.xtext.util,
org.eclipse.emf.ecore,
org.eclipse.emf.common,
org.antlr.runtime,
org.eclipse.xtext.common.types;bundle-version="2.2.1",
org.eclipse.xtext.xbase;bundle-version="2.2.1"
Import-Package: org.apache.log4j,
org.apache.commons.logging,
org.eclipse.xtext.xbase.lib,
org.eclipse.xtext.xtend2.lib,
org.eclipse.xtend2.lib
From my dsl file:
grammar org.jjflyboy.tjpeditor.Project with org.eclipse.xtext.common.Terminals
generate project "http://www.jjflyboy.org/tjpeditor/Project"
import "http://www.eclipse.org/emf/2002/Ecore" as ecore
import "http://www.eclipse.org/xtext/xbase/Xbase" as xbase
0 [main] INFO lipse.emf.mwe.utils.StandaloneSetup - Registering platform uri '/home/john/projects/tjpeditor'
279 [main] INFO clipse.emf.mwe.utils.GenModelHelper - Registered GenModel 'http://www.eclipse.org/Xtext/Xbase/XAnnotations' from 'platform:/resource/org.eclipse.xtext.xbase/model/Xbase.genmodel'
282 [main] INFO clipse.emf.mwe.utils.GenModelHelper - Registered GenModel 'http://www.eclipse.org/xtext/xbase/Xtype' from 'platform:/resource/org.eclipse.xtext.xbase/model/Xbase.genmodel'
295 [main] INFO clipse.emf.mwe.utils.GenModelHelper - Registered GenModel 'http://www.eclipse.org/xtext/xbase/Xbase' from 'platform:/resource/org.eclipse.xtext.xbase/model/Xbase.genmodel'
296 [main] INFO clipse.emf.mwe.utils.GenModelHelper - Registered GenModel 'http://www.eclipse.org/xtext/common/JavaVMTypes' from 'platform:/resource/org.eclipse.xtext.common.types/model/JavaVMTypes.genmodel'
1700 [main] ERROR ipse.xtext.generator.LanguageConfig - [XtextLinkingDiagnostic: null:3 Couldn't resolve reference to EPackage 'http://www.eclipse.org/xtext/xbase/Xbase'.]
1703 [main] ERROR mf.mwe2.launch.runtime.Mwe2Launcher - Problems instantiating module org.jjflyboy.tjpeditor.GenerateProject: java.lang.reflect.InvocationTargetException
java.lang.RuntimeException: Problems instantiating module org.jjflyboy.tjpeditor.GenerateProject: java.lang.reflect.InvocationTargetException
at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:90)
at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:73)
at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:64)
at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:55)
at org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher.run(Mwe2Launcher.java:74)
at org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher.main(Mwe2Launcher.java:35)
Caused by: org.eclipse.emf.common.util.WrappedException: java.lang.reflect.InvocationTargetException
at org.eclipse.emf.mwe2.language.factory.SettingProviderImpl$1$1.setValue(SettingProviderImpl.java:56)
at org.eclipse.emf.mwe2.language.factory.Mwe2ExecutionEngine.internalApplyAssignments(Mwe2ExecutionEngine.java:143)
at org.eclipse.emf.mwe2.language.factory.Mwe2ExecutionEngine.inCase(Mwe2ExecutionEngine.java:114)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.eclipse.xtext.util.PolymorphicDispatcher.invoke(PolymorphicDispatcher.java:291)
at org.eclipse.emf.mwe2.language.factory.Mwe2ExecutionEngine.internalSwitch(Mwe2ExecutionEngine.java:66)
at org.eclipse.emf.mwe2.language.factory.Mwe2ExecutionEngine.internalApplyAssignments(Mwe2ExecutionEngine.java:142)
at org.eclipse.emf.mwe2.language.factory.Mwe2ExecutionEngine.inCase(Mwe2ExecutionEngine.java:114)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.eclipse.xtext.util.PolymorphicDispatcher.invoke(PolymorphicDispatcher.java:291)
at org.eclipse.emf.mwe2.language.factory.Mwe2ExecutionEngine.internalSwitch(Mwe2ExecutionEngine.java:66)
at org.eclipse.emf.mwe2.language.factory.Mwe2ExecutionEngine.internalApplyAssignments(Mwe2ExecutionEngine.java:142)
at org.eclipse.emf.mwe2.language.factory.Mwe2ExecutionEngine.inCase(Mwe2ExecutionEngine.java:114)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.eclipse.xtext.util.PolymorphicDispatcher.invoke(PolymorphicDispatcher.java:291)
at org.eclipse.emf.mwe2.language.factory.Mwe2ExecutionEngine.internalSwitch(Mwe2ExecutionEngine.java:66)
at org.eclipse.emf.mwe2.language.factory.Mwe2ExecutionEngine.inCase(Mwe2ExecutionEngine.java:80)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.eclipse.xtext.util.PolymorphicDispatcher.invoke(PolymorphicDispatcher.java:291)
at org.eclipse.emf.mwe2.language.factory.Mwe2ExecutionEngine.internalSwitch(Mwe2ExecutionEngine.java:66)
at org.eclipse.emf.mwe2.language.factory.Mwe2ExecutionEngine.create(Mwe2ExecutionEngine.java:62)
at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:88)
... 5 more
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.eclipse.emf.mwe2.language.factory.SettingProviderImpl$1$1.setValue(SettingProviderImpl.java:54)
... 38 more
Caused by: java.lang.IllegalStateException: Problem parsing 'classpath:/org/jjflyboy/tjpeditor/Project.xtext':[XtextLinkingDiagnostic: null:3 Couldn't resolve reference to EPackage 'http://www.eclipse.org/xtext/xbase/Xbase'.]
at org.eclipse.xtext.generator.LanguageConfig.setUri(LanguageConfig.java:185)
... 43 more