Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » EMF : Error loading XMI file(IllegalValueException when opening an XMI file using "Simple Reflective Ecore Model Editor)
EMF : Error loading XMI file [message #1690321] Thu, 26 March 2015 15:11 Go to next message
Amel B. is currently offline Amel B.Friend
Messages: 4
Registered: March 2015
Junior Member
When I try to open XMI file using Simple Reflective Ecore Model Editor, I get the following error : org.eclipse.emf.ecore.xmi.IllegalValueException: Value 'org.eclipse.emf.ecore.impl.DynamicEObjectImpl@9f8c5d (eClass: org.eclipse.emf.ecore.impl.EClassImpl@1cf9acb (name: PartnerLinkType) (instanceClassName: null) (abstract: false, interface: false))' is not legal. (platform:/resource/...).
.....
java.lang.ArrayStoreException: org.eclipse.emf.ecore.impl.DynamicEObjectImpl
at org.eclipse.emf.common.util.BasicEList.assign(BasicEList.java:118)
....

The XMI file is an instance of an ecore WSDL metamodel which refer to the partnerlinktype metamodel. The file to load refer to an object of Kind "PartnerLinkType" whose instance is contained in "PLNK "resource. The following XMI file fails to do that:
Re: EMF : Error loading XMI file [message #1690385 is a reply to message #1690321] Fri, 27 March 2015 05:22 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 30458
Registered: July 2009
Senior Member
Amel,

Probably there is a generated model for WSDL which you're extending,
right? Likely your extension PartnerLinkType EClass has whatever is the
EClass of the Definition.eExtensibilityElements reference's type is
(ExtensibilityElement?) as its eSuperType. But, the question is whether
your extension is using the generated WSDL model for this eSuperType
(ExtensibilityElement)? If not, the dynamic instance will not actually
reuse the generated base class from the WSDL model
(ExtensibilityElementImpl), which is apparently the case because it's
definitely using DynamicEObjectImpl according to your stack trace. Note
the features for models all support fail-fast type safety, so for a
generated model:

public EList<EEnumLiteral> getELiterals()
{
if (eLiterals == null)
{
eLiterals = new
EObjectContainmentWithInverseEList<EEnumLiteral>(EEnumLiteral.class,
this, EcorePackage.EENUM__ELITERALS, EcorePackage.EENUM_LITERAL__EENUM);
}
return eLiterals;
}

Note the first argument is the class literal and it must be the base
type of anything added to this list.

You can tell if your extension model is using the generated version of
WSDL if the reference in PartnerLinkType is using WSDL's eNS_URI value
to refer to ExtensibilityElement rather than a relative URI or
platform:/resource URI...


On 26/03/2015 4:11 PM, Amel B. wrote:
> When I try to open XMI file using Simple Reflective Ecore Model Editor, I get the following error : org.eclipse.emf.ecore.xmi.IllegalValueException: Value mailto:'org.eclipse.emf.ecore.impl.DynamicEObjectImpl@9f8c5d (eClass: mailto:org.eclipse.emf.ecore.impl.EClassImpl@1cf9acb (name: PartnerLinkType) (instanceClassName: null) (abstract: false, interface: false))' is not legal. (platform:/resource/...).
> ....
> java.lang.ArrayStoreException: org.eclipse.emf.ecore.impl.DynamicEObjectImpl
> at org.eclipse.emf.common.util.BasicEList.assign(BasicEList.java:118)
> ...
>
> The XMI file is an instance of an ecore WSDL metamodel which refer to the partnerlinktype metamodel. The file to load refer to an object of Kind "PartnerLinkType" whose instance is contained in "PLNK "resource. The following XMI file fails to do that:
>
Re: EMF : Error loading XMI file [message #1690559 is a reply to message #1690385] Sat, 28 March 2015 21:19 Go to previous message
Amel B. is currently offline Amel B.Friend
Messages: 4
Registered: March 2015
Junior Member
Ed,
the issue is solved. You are right, the PartnerLinkType used platform:/resource URI to refer to ExtensibilityElement rather than using WSDL's eNS_URI.
Thanks so much for your help!
Previous Topic:EMF : Error loading XMI file
Next Topic:EMF : Code generation from ecore and genmodel
Goto Forum:
  


Current Time: Sat Sep 21 17:31:44 GMT 2019

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

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

Back to the top