Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » MoDisco » Cast Errors in a Custom Metamodel
Cast Errors in a Custom Metamodel [message #1809479] Tue, 16 July 2019 17:58 Go to next message
Daniel San Martín is currently offline Daniel San MartínFriend
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

Re: Cast Errors in a Custom Metamodel [message #1809583 is a reply to message #1809479] Thu, 18 July 2019 14:04 Go to previous messageGo to next message
Daniel San Martín is currently offline Daniel San MartínFriend
Messages: 45
Registered: October 2012
Member
Hello,

I changed some things in my project. When I try to run as eclipse runtime and create a new model it raises the follwing error.

Caused by: java.lang.NoClassDefFoundError: org/eclipse/gmt/modisco/omg/kdm/core/provider/KdmEditPlugin

I also changed restriction rules to accesible.


Thanks,


Re: Cast Errors in a Custom Metamodel [message #1809713 is a reply to message #1809583] Sun, 21 July 2019 23:26 Go to previous message
Daniel San Martín is currently offline Daniel San MartínFriend
Messages: 45
Registered: October 2012
Member
I resolved it by creating the model programmatically.
Previous Topic:Code Generation - Unresolved Reference in GenerateJava.emtl
Next Topic:Unable to get KDM Plugin installed
Goto Forum:
  


Current Time: Fri Nov 08 15:03:36 GMT 2024

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

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

Back to the top