[EMF] unable to re-import an exported XMI repo [message #803016] |
Mon, 20 February 2012 20:38 |
Mark Geib Messages: 432 Registered: July 2009 |
Senior Member |
|
|
I am having trouble importing an XMI file into an EMF model after generating the file from an export of the same model. I am currently using the Teneo supplied datastore.export method, but have also tried coping the resource using the EMF copier and the result is the same, that is the XMI file generated is the same. The XMI is:
<?xml version="1.0" encoding="ASCII"?>
<srd:Echostar xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:srd="http://srd" echostarId="1">
<contactList contactListId="1"/>
<facilities description="Cheyenne uplink" name="Cheyenne" facilityId="1">
<namedEquipmentList namedEquipmentListId="1">
<namedEquipment xsi:type="srd:ACO" description="--New Equipment--" Id="--New--" services="1" equipmentLocations="1" namedEquipmentId="1"/>
</namedEquipmentList>
<groups xsi:type="srd:AllServices" abstractServiceGroupId="1">
<services EPGName="--New--" namedEquipment="1" serviceId="1">
<locations x="358" y="166" namedEquipment="1" locationId="1"/>
</services>
</groups>
</facilities>
<facilities description="Gilbert uplink" name="Gilbert" facilityId="2">
<namedEquipmentList namedEquipmentListId="2"/>
<groups xsi:type="srd:AllServices" abstractServiceGroupId="2"/>
</facilities>
</srd:Echostar>
When I try to do an import with either the Teneo datastore.import() method or manually when the resource is created with
...
resX = (XMIResource)xmlResSet.getResource(URI.createURI("file:/tmp/srd.xmi"), true);
...
it fails with the exception:
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl$1DiagnosticWrappedException: org.eclipse.emf.ecore.xmi.IllegalValueException: Value 'srd.impl.EchostarImpl@7f32e233 (echostarId: 1)' is not legal. (file:/tmp/srd.xmi, 6, 145)
at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.handleDemandLoadException(ResourceSetImpl.java:315)
at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLoadHelper(ResourceSetImpl.java:274)
at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResource(ResourceSetImpl.java:397)
at srd.view.navigator.actions.NavigatorImportXMIAction.run(NavigatorImportXMIAction.java:50)
at org.eclipse.jface.action.Action.runWithEvent(Action.java:498)
at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:584)
at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:501)
at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:411)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4128)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1457)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1480)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1465)
at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1270)
...
Caused by: org.eclipse.emf.ecore.xmi.IllegalValueException: Value 'srd.impl.EchostarImpl@7f32e233 (echostarId: 1)' is not legal. (file:/tmp/srd.xmi, 6, 145)
at org.eclipse.emf.ecore.xmi.impl.XMLHandler.setFeatureValue(XMLHandler.java:2663)
at org.eclipse.emf.ecore.xmi.impl.XMLHandler.setFeatureValue(XMLHandler.java:2648)
at org.eclipse.emf.ecore.xmi.impl.XMLHandler.setValueFromId(XMLHandler.java:2819)
at org.eclipse.emf.ecore.xmi.impl.XMLHandler.setAttribValue(XMLHandler.java:2721)
at org.eclipse.emf.ecore.xmi.impl.SAXXMIHandler.handleObjectAttribs(SAXXMIHandler.java:85)
at org.eclipse.emf.ecore.xmi.impl.XMLHandler.createObjectFromFactory(XMLHandler.java:2193)
...
Caused by: java.lang.ArrayStoreException: srd.impl.EchostarImpl
at org.eclipse.emf.common.util.BasicEList.assign(BasicEList.java:124)
at org.eclipse.emf.common.util.BasicEList.addUnique(BasicEList.java:424)
at org.eclipse.emf.common.notify.impl.NotifyingListImpl.doAddUnique(NotifyingListImpl.java:331)
at org.eclipse.emf.common.notify.impl.NotifyingListImpl.addUnique(NotifyingListImpl.java:315)
at org.eclipse.emf.ecore.xmi.impl.XMLHelperImpl.setValue(XMLHelperImpl.java:1179)
I am at a lose here as to what the problem is. I am running current updated versions of Eclipse/EMF/Teneo and hibernate, etc. I have done this many time is the past with older versions of EMF/Teneo (2.5..) to export and import my Teneo repo.
Thanks,
Mark.
|
|
|
Re: [EMF] unable to re-import an exported XMI repo [message #803035 is a reply to message #803016] |
Mon, 20 February 2012 21:16 |
Ed Merks Messages: 33218 Registered: July 2009 |
Senior Member |
|
|
Mark,
See my comment in the other thread? I have a feeling that echostarId
has type xsd:ID so it must be an NCName yet isn't.
On 20/02/2012 9:38 PM, Mark Geib wrote:
> I am having trouble importing an XMI file into an EMF model after
> generating the file from an export of the same model. I am currently
> using the Teneo supplied datastore.export method, but have also tried
> coping the resource using the EMF copier and the result is the same,
> that is the XMI file generated is the same. The XMI is:
>
> <?xml version="1.0" encoding="ASCII"?>
> <srd:Echostar xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xmlns:srd="http://srd" echostarId="1">
> <contactList contactListId="1"/>
> <facilities description="Cheyenne uplink" name="Cheyenne" facilityId="1">
> <namedEquipmentList namedEquipmentListId="1">
> <namedEquipment xsi:type="srd:ACO" description="--New Equipment--"
> Id="--New--" services="1" equipmentLocations="1" namedEquipmentId="1"/>
> </namedEquipmentList>
> <groups xsi:type="srd:AllServices" abstractServiceGroupId="1">
> <services EPGName="--New--" namedEquipment="1" serviceId="1">
> <locations x="358" y="166" namedEquipment="1" locationId="1"/>
> </services>
> </groups>
> </facilities>
> <facilities description="Gilbert uplink" name="Gilbert" facilityId="2">
> <namedEquipmentList namedEquipmentListId="2"/>
> <groups xsi:type="srd:AllServices" abstractServiceGroupId="2"/>
> </facilities>
> </srd:Echostar>
>
> When I try to do an import with either the Teneo datastore.import()
> method or manually when the resource is created with
> ..
> resX =
> (XMIResource)xmlResSet.getResource(URI.createURI("file:/tmp/srd.xmi"),
> true);
> ..
> it fails with the exception:
>
>
> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl$1DiagnosticWrappedException:
> org.eclipse.emf.ecore.xmi.IllegalValueException: Value
> mailto:'srd.impl.EchostarImpl@7f32e233 (echostarId: 1)' is not legal.
> (file:/tmp/srd.xmi, 6, 145)
> at
> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.handleDemandLoadException(ResourceSetImpl.java:315)
> at
> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLoadHelper(ResourceSetImpl.java:274)
> at
> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResource(ResourceSetImpl.java:397)
> at
> srd.view.navigator.actions.NavigatorImportXMIAction.run(NavigatorImportXMIAction.java:50)
> at org.eclipse.jface.action.Action.runWithEvent(Action.java:498)
> at
> org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:584)
> at
> org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:501)
> at
> org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:411)
> at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
> at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4128)
> at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1457)
> at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1480)
> at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1465)
> at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1270)
> ..
>
> Caused by: org.eclipse.emf.ecore.xmi.IllegalValueException: Value
> mailto:'srd.impl.EchostarImpl@7f32e233 (echostarId: 1)' is not legal.
> (file:/tmp/srd.xmi, 6, 145)
> at
> org.eclipse.emf.ecore.xmi.impl.XMLHandler.setFeatureValue(XMLHandler.java:2663)
> at
> org.eclipse.emf.ecore.xmi.impl.XMLHandler.setFeatureValue(XMLHandler.java:2648)
> at
> org.eclipse.emf.ecore.xmi.impl.XMLHandler.setValueFromId(XMLHandler.java:2819)
> at
> org.eclipse.emf.ecore.xmi.impl.XMLHandler.setAttribValue(XMLHandler.java:2721)
> at
> org.eclipse.emf.ecore.xmi.impl.SAXXMIHandler.handleObjectAttribs(SAXXMIHandler.java:85)
> at
> org.eclipse.emf.ecore.xmi.impl.XMLHandler.createObjectFromFactory(XMLHandler.java:2193)
> ..
>
> Caused by: java.lang.ArrayStoreException: srd.impl.EchostarImpl
> at org.eclipse.emf.common.util.BasicEList.assign(BasicEList.java:124)
> at
> org.eclipse.emf.common.util.BasicEList.addUnique(BasicEList.java:424)
> at
> org.eclipse.emf.common.notify.impl.NotifyingListImpl.doAddUnique(NotifyingListImpl.java:331)
> at
> org.eclipse.emf.common.notify.impl.NotifyingListImpl.addUnique(NotifyingListImpl.java:315)
> at
> org.eclipse.emf.ecore.xmi.impl.XMLHelperImpl.setValue(XMLHelperImpl.java:1179)
>
>
> I am at a lose here as to what the problem is. I am running current
> updated versions of Eclipse/EMF/Teneo and hibernate, etc. I have done
> this many time is the past with older versions of EMF/Teneo (2.5..) to
> export and import my Teneo repo.
>
> Thanks,
> Mark.
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Powered by
FUDForum. Page generated in 0.03594 seconds