Eclipse Community Forums - RDF feed
https://www.eclipse.org/forums/
Eclipse Community ForumsEMF : Error loading XMI file
https://www.eclipse.org/forums/index.php/mv/msg/1065157/1690321/#msg_1690321
'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:
]]>Amel B.2015-03-26T15:11:15-00:00Re: EMF : Error loading XMI file
https://www.eclipse.org/forums/index.php/mv/msg/1065157/1690385/#msg_1690385
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:
>]]>Ed Merks2015-03-27T05:22:20-00:00Re: EMF : Error loading XMI file
https://www.eclipse.org/forums/index.php/mv/msg/1065157/1690559/#msg_1690559
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! ]]>Amel B.2015-03-28T21:19:04-00:00