Reading XMI error? [message #885561] |
Wed, 13 June 2012 08:53 |
Kosala Yapa Messages: 159 Registered: September 2010 |
Senior Member |
|
|
Hi,
A part of ecore file: [HeadModule is extended from Module]
<eClassifiers xsi:type="ecore:EClass" name="Module">
<eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType .../emf/2002/Ecore#//EString"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="deviceID" eType="ecore:EDataType .../emf/2002/Ecore#//EString"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="partNumber" eType="ecore:EDataType ..../emf/2002/Ecore#//EString"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="width" eType="ecore:EDataType .../emf/2002/Ecore#//EString"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="baseModule" eType="ecore:EDataType .../emf/2002/Ecore#//EString"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="slotWidth" eType="ecore:EDataType .../emf/2002/Ecore#//EString"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="s7ModuleReference" eType="ecore:EDataType ..../emf/2002/Ecore#//EString"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="isSelectedWithinStep7"
eType="ecore:EDataType .../emf/2002/Ecore#//EString"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="config" eType="ecore:EDataType .../emf/2002/Ecore#//EString"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="HeadModule" eSuperTypes="#//Module">
<eStructuralFeatures xsi:type="ecore:EAttribute" name="hType" eType="ecore:EDataType .../emf/2002/Ecore#//EString"/>
</eClassifiers>
reading xmi input ->java code:
Resource resource = resourceSet.getResource(URI.createFileURI("/Temp/aaa.xmi"),true);
Project root = (Project) model.ModelFactory.eINSTANCE.createProject();
root=(Project)resource.getContents().get(0);
Error->
Exception in thread "main" org.eclipse.emf.ecore.resource.impl.ResourceSetImpl$1DiagnosticWrappedException: org.eclipse.emf.ecore.xmi.IllegalValueException: Value 'model.impl.ModuleImpl@12b24bc (name: PSSuniversal2222, deviceID: 0x00000229, partNumber: null, width: null, baseModule: null, slotWidth: null, s7ModuleReference: {2C9A8CF2-2D1B-4F62-A084-1630B9C09817}{001417C4-0000002B-001417C3-0000002A-00112001-00000107}{SD_example1}, isSelectedWithinStep7: false, config: null)' is not legal. (file:///Temp/tpfOut.xmi, 18, 239)
at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.handleDemandLoadException(ResourceSetImpl.java:315)
Could someone give me a hit to solve this issue?
Thanks in advance.
K
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03426 seconds