Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Problem with imported model when referencing Xbase and JavaVMTypes models
Problem with imported model when referencing Xbase and JavaVMTypes models [message #878779] Tue, 29 May 2012 23:11 Go to next message
Filip Krikava is currently offline Filip KrikavaFriend
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 97 times)
Re: Problem with imported model when referencing Xbase and JavaVMTypes models [message #878924 is a reply to message #878779] Wed, 30 May 2012 08:11 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13525
Registered: July 2009
Senior Member
Hi,

Sounds like a bug to me,
would you please file a ticket?

~Christian


Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/xtext/
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Problem with imported model when referencing Xbase and JavaVMTypes models [message #879806 is a reply to message #878924] Thu, 31 May 2012 21:50 Go to previous message
Filip Krikava is currently offline Filip KrikavaFriend
Messages: 45
Registered: January 2012
Member
Filed: 381281 https[:]//bugs.eclipse.org/bugs/show_bug.cgi?id=381281
Previous Topic:Migrating unknown version of Xtext to XText 2.x
Next Topic:[Solved] How to configure a custom QualifiedNameProvider?
Goto Forum:
  


Current Time: Wed Aug 12 01:18:24 GMT 2020

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

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

Back to the top