Problem with imported model when referencing Xbase and JavaVMTypes models [message #878779] |
Tue, 29 May 2012 23:11 |
Filip Krikava Messages: 45 Registered: January 2012 |
Member |
|
|
Hi,
When I use generated model everything works fine, but when I try to use imported model (which is the copy of the generated one) it does not work. To be concrete I created a very simple grammar:
grammar test.DSL2 with org.eclipse.xtext.xbase.Xbase
generate dSL2 "http[:]//www.DSL2.test"
System returns System:
{System}
'System'
'{'
('types' '(' types+=JvmTypeReference ( "," types+=JvmTypeReference)* ')' )?
'}';
This works as expected, but when I changed it to:
import "platform:/resource/test.model/model/model.ecore"
where the model.{ecore, genmodel} are the same as the generated one, then during the MW2 execution I get:
1272 [main] ERROR ipse.xtext.generator.LanguageConfig - [TransformationDiagnostic: null:10 Cannot find compatible feature types in sealed EClass System from imported package http[:]//model.me/model: The existing reference 'types' has an incompatible type 'JvmTypeReference'. The expected type is 'JvmTypeReference' [org.eclipse.xtext.common.types.JvmTypeReference]. (ErrorCode: CannotCreateTypeInSealedMetamodel), TransformationDiagnostic: null:10 Cannot find compatible feature types in sealed EClass System from imported package http[:]//model.me/model: The existing reference 'types' has an incompatible type 'JvmTypeReference'. The expected type is 'JvmTypeReference' [org.eclipse.xtext.common.types.JvmTypeReference]. (ErrorCode: CannotCreateTypeInSealedMetamodel)]
1275 [main] ERROR mf.mwe2.launch.runtime.Mwe2Launcher - Problems instantiating module test.DSL: java.lang.reflect.InvocationTargetException
java.lang.RuntimeException: Problems instantiating module test.DSL: 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:/test/DSL.xtext':[TransformationDiagnostic: null:10 Cannot find compatible feature types in sealed EClass System from imported package http[:]//model.me/model: The existing reference 'types' has an incompatible type 'JvmTypeReference'. The expected type is 'JvmTypeReference' [org.eclipse.xtext.common.types.JvmTypeReference]. (ErrorCode: CannotCreateTypeInSealedMetamodel), TransformationDiagnostic: null:10 Cannot find compatible feature types in sealed EClass System from imported package http[:]//model.me/model: The existing reference 'types' has an incompatible type 'JvmTypeReference'. The expected type is 'JvmTypeReference' [org.eclipse.xtext.common.types.JvmTypeReference]. (ErrorCode: CannotCreateTypeInSealedMetamodel)]
at org.eclipse.xtext.generator.LanguageConfig.setUri(LanguageConfig.java:185)
... 43 more
The relevant message is: The existing reference 'types' has an incompatible type 'JvmTypeReference'. The expected type is 'JvmTypeReference' [org.eclipse.xtext.common.types.JvmTypeReference]
I would say they are actually the same. Here is the relevant part form the model.ecore file:
<eClassifiers xsi:type="ecore:EClass" name="System">
<eStructuralFeatures xsi:type="ecore:EReference" name="types" upperBound="-1"
eType="ecore:EClass ../../org.eclipse.xtext.common.types/model/JavaVMTypes.ecore#//JvmTypeReference"
containment="true"/>
</eClassifiers>
Does anybody know where the problem might be?
Thanks a lot for help!
In the attachment I created a two xtext projects test.dsl (imported model) and test.dsl2 (generated model).
-
Attachment: Archive.zip
(Size: 1.63MB, Downloaded 128 times)
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.02980 seconds