Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » UML2 » XMI idref reading error
XMI idref reading error [message #1734095] Fri, 03 June 2016 17:10
Raphael B is currently offline Raphael BFriend
Messages: 14
Registered: April 2013
Junior Member
(this is a repost of )
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">
  <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">
    <annotatedElement xmi:idref="SysML.package_packagedElement_Activities.stereotype_packagedElement_Continuous"/>

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 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?

Previous Topic:How to use UML2 with Maven
Next Topic:How to add time related information in state machine?
Goto Forum:

Current Time: Tue Mar 20 10:05:04 GMT 2018

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

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