Cast Errors in a Custom Metamodel [message #1809479] |
Tue, 16 July 2019 17:58 |
Daniel San Martín Messages: 45 Registered: October 2012 |
Member |
|
|
Hello,
I created a custom metamodel and an instance of it. The metamodel handles some metadata from the KDM metamodel. Specifically, KDMEntity and AbstractStructureElement. I attached the metamodel RMSAS for better understanding.
When I create an instance manually, everything works fine but when I need to open the instance with the reflective ecore model editor, it raises cast errors.
StorableUnitImpl cannot be cast to KDMEntity.
org.eclipse.emf.ecore.xmi.IllegalValueException: Value 'org.eclipse.gmt.modisco.omg.kdm.code.impl.StorableUnitImpl@56479f53
..
..
Caused by: java.lang.ClassCastException: org.eclipse.gmt.modisco.omg.kdm.code.impl.StorableUnitImpl cannot be cast to kdm.core.KDMEntity
and
ComponentImpl cannot be cast to AbstractStructureElement
org.eclipse.emf.ecore.xmi.IllegalValueException: Value 'org.eclipse.gmt.modisco.omg.kdm.structure.impl.ComponentImpl@78ca78cd
..
..
Caused by: java.lang.ClassCastException: org.eclipse.gmt.modisco.omg.kdm.structure.impl.ComponentImpl cannot be cast to kdm.structure.AbstractStructureElement
I use KDMEntity because I want to represent StorableUnits, ClassUnits and MethodUnits and from the structure package AbstractStructureElement because I want to represent Components and Subsystems.
How can I solve these issues?. What kind of metadata do I should use to avoid casts errors?
Regards,
Daniel
-
Attachment: RMSAS.png
(Size: 317.09KB, Downloaded 89 times)
[Updated on: Wed, 17 July 2019 01:48] Report message to a moderator
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03202 seconds