XMI idref reading error [message #1734095] |
Fri, 03 June 2016 17:10 |
Raphael B Messages: 14 Registered: April 2013 |
Junior Member |
|
|
Hello,
(this is a repost of https://www.eclipse.org/forums/index.php/t/1078068/ )
As I was upgrading my Ecore libraries, I got the following error when reading a file:
org.eclipse.emf.ecore.xmi.IllegalValueException: Value 'org.eclipse.emf.ecore.xml.type.impl.AnyTypeImpl@5607ce2 (eClass: org.eclipse.emf.ecore.impl.EClassImpl@3c2bbbf0 (name: Element) (instanceClassName: null) (abstract: false, interface: false)) (mixed: null, anyAttribute: [XMI_20131001:idref=SysML.package_packagedElement_Activities.stereotype_packagedElement_Continuous])' is not legal.
The relevant XMI content is the following:
<packagedElement xmi:id="SysML.package_packagedElement_Activities.stereotype_packagedElement_Continuous" xmi:uuid="org.omg.sysml.SysML.package_packagedElement_Activities.stereotype_packagedElement_Continuous" xmi:type="uml:Stereotype">
<name>Continuous</name>
<ownedComment xmi:id="SysML.package_packagedElement_Activities.stereotype_packagedElement_Continuous._ownedComment.0" xmi:uuid="org.omg.sysml.SysML.package_packagedElement_Activities.stereotype_packagedElement_Continuous._ownedComment.0" xmi:type="uml:Comment">
<body>
...
</body>
<annotatedElement xmi:idref="SysML.package_packagedElement_Activities.stereotype_packagedElement_Continuous"/>
</ownedComment>
I'm guessing I get this error because the type of the annotatedElement is UML Element, which is abstract, so a proxy can't be created. Now, I don't know why a proxy would be created since the actual element should have been created already.
My code was working with EMF (ecore+ecore.xmi) 2.11.0, meaning that element with idrefs didn't require a xmi:type to be read. The code doesn't work anymore in 2.11.1, so I'm suspecting http://git.eclipse.org/c/emf/org.eclipse.emf.git/commit/?h=R2_11_maintenance&id=da4f80486a37c34d9eae223dd38fa9ee873ca36d to have introduced the problem, but I don't know EMF well enough to say.
Is there a workaround that does not involve adding an xmi:type to all idrefs?
Thanks!
|
|
|
Powered by
FUDForum. Page generated in 0.02820 seconds