Home » Modeling » EMF » How to debug a XMI load error?
How to debug a XMI load error? [message #1404092] |
Tue, 29 July 2014 15:03 |
Mauro Condarelli Messages: 428 Registered: September 2009 |
Senior Member |
|
|
Hi,
I'm faced with a (cryptic) load error.
I'm using EMF in standalone mode in a Maven project (if it matters).
I'm saving my (complex!) model as XMI.
During final testing of my application it saved a model now it's unable to read back.
I get the message (full stack trace at bottom):
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl$1DiagnosticWrappedException: org.eclipse.emf.ecore.xmi.IllegalValueException: Value 'com.voith.hyconmde.model.hyconmde.impl.SensorImpl@27aa8ff3 (id: 100029, eId: Sensor(100029), name: Clear, myStatus: VALID, status: VALID, decorator: null) (measureDirection: , valueOffset: 0.0, phaseOffset: 0.0, xHarmonic: 0.0, normalizationFactor: 1.0)' is not legal. (file:/C:/Users/mcon/.Voith/data/default.hyconmde, -1, -1)
"culprit" is the middle line in this short excerpt of my model:
<sensors id="100028" name="AG" inputs="Signal(10021008)" type="SensorType(004)" input0="Signal(10021008)" valueOffset="0.0" phaseOffset="0.0" xHarmonic="0.0" normalizationFactor="1.0"/>
<sensors id="100029" name="Clear" inputs="Signal(10050001)" type="SensorType(005)" input0="Signal(10050001)" valueOffset="0.0" phaseOffset="0.0" xHarmonic="0.0" normalizationFactor="1.0"/>
<sensors id="100030" name="M Flux" inputs="Signal(10050004)" type="SensorType(006)" input0="Signal(10050004)" valueOffset="0.0" phaseOffset="0.0" xHarmonic="0.0" normalizationFactor="1.0"/>
I cannot see any (structural) difference in the tree lines.
Can someone suggest a way to debug this?
I'm at a complete loss here.
I can post the full model, if useful.
Thanks in Advance
Mauro
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl$1DiagnosticWrappedException: org.eclipse.emf.ecore.xmi.IllegalValueException: Value 'com.voith.hyconmde.model.hyconmde.impl.SensorImpl@27aa8ff3 (id: 100029, eId: Sensor(100029), name: Clear, myStatus: VALID, status: VALID, decorator: null) (measureDirection: , valueOffset: 0.0, phaseOffset: 0.0, xHarmonic: 0.0, normalizationFactor: 1.0)' is not legal. (file:/C:/Users/mcon/.Voith/data/default.hyconmde, -1, -1)
at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.handleDemandLoadException(ResourceSetImpl.java:319)
at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLoadHelper(ResourceSetImpl.java:278)
at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResource(ResourceSetImpl.java:406)
at com.voith.hyconmde.core.AbstractModelService.getResource(AbstractModelService.java:154)
at com.voith.hyconmde.core.AbstractModelService.getRoot(AbstractModelService.java:223)
at com.voith.hyconmde.ui.VoithMDEApp$1.call(VoithMDEApp.java:149)
at com.voith.hyconmde.ui.VoithMDEApp$1.call(VoithMDEApp.java:1)
at javafx.concurrent.Task$TaskCallable.call(Task.java:1426)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.lang.Thread.run(Thread.java:745)
Caused by: org.eclipse.emf.ecore.xmi.IllegalValueException: Value 'com.voith.hyconmde.model.hyconmde.impl.SensorImpl@27aa8ff3 (id: 100029, eId: Sensor(100029), name: Clear, myStatus: VALID, status: VALID, decorator: null) (measureDirection: , valueOffset: 0.0, phaseOffset: 0.0, xHarmonic: 0.0, normalizationFactor: 1.0)' is not legal. (file:/C:/Users/mcon/.Voith/data/default.hyconmde, -1, -1)
at org.eclipse.emf.ecore.xmi.impl.XMLHandler.setFeatureValue(XMLHandler.java:2671)
at org.eclipse.emf.ecore.xmi.impl.XMLHandler.handleForwardReferences(XMLHandler.java:1156)
at org.eclipse.emf.ecore.xmi.impl.XMLHandler.endDocument(XMLHandler.java:1235)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endDocument(AbstractSAXParser.java:745)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:515)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:848)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:777)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1213)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:649)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl.parse(SAXParserImpl.java:333)
at org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.load(XMLLoadImpl.java:175)
at org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doLoad(XMLResourceImpl.java:253)
at org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(ResourceImpl.java:1518)
at org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(ResourceImpl.java:1297)
at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLoad(ResourceSetImpl.java:259)
at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLoadHelper(ResourceSetImpl.java:274)
... 8 more
Caused by: java.lang.ArrayIndexOutOfBoundsException: -1
at org.eclipse.emf.common.util.BasicEList.move(BasicEList.java:663)
at org.eclipse.emf.common.notify.impl.NotifyingListImpl.doMove(NotifyingListImpl.java:1329)
at org.eclipse.emf.common.notify.impl.NotifyingListImpl.move(NotifyingListImpl.java:1314)
at org.eclipse.emf.common.util.AbstractEList.move(AbstractEList.java:533)
at org.eclipse.emf.ecore.xmi.impl.XMLHelperImpl.setValue(XMLHelperImpl.java:1198)
at org.eclipse.emf.ecore.xmi.impl.XMLHandler.setFeatureValue(XMLHandler.java:2666)
... 24 more
|
|
|
Re: How to debug a XMI load error? [message #1404118 is a reply to message #1404092] |
Tue, 29 July 2014 17:37 |
Ed Merks Messages: 33218 Registered: July 2009 |
Senior Member |
|
|
Mauro,
Comments below.
On 29/07/2014 5:03 PM, Mauro Condarelli wrote:
> Hi,
> I'm faced with a (cryptic) load error.
>
> I'm using EMF in standalone mode in a Maven project (if it matters).
> I'm saving my (complex!) model as XMI.
> During final testing of my application it saved a model now it's
> unable to read back.
>
> I get the message (full stack trace at bottom):
>
> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl$1DiagnosticWrappedException:
> org.eclipse.emf.ecore.xmi.IllegalValueException: Value
> 'com.voith.hyconmde.model.hyconmde.impl.SensorImpl@27aa8ff3 (id:
> 100029, eId: Sensor(100029), name: Clear, myStatus: VALID, status:
> VALID, decorator: null) (measureDirection: , valueOffset: 0.0,
> phaseOffset: 0.0, xHarmonic: 0.0, normalizationFactor: 1.0)' is not
> legal. (file:/C:/Users/mcon/.Voith/data/default.hyconmde, -1, -1)
>
> "culprit" is the middle line in this short excerpt of my model:
>
> <sensors id="100028" name="AG" inputs="Signal(10021008)"
> type="SensorType(004)" input0="Signal(10021008)" valueOffset="0.0"
> phaseOffset="0.0" xHarmonic="0.0" normalizationFactor="1.0"/>
> <sensors id="100029" name="Clear" inputs="Signal(10050001)"
> type="SensorType(005)" input0="Signal(10050001)" valueOffset="0.0"
> phaseOffset="0.0" xHarmonic="0.0" normalizationFactor="1.0"/>
> <sensors id="100030" name="M Flux" inputs="Signal(10050004)"
> type="SensorType(006)" input0="Signal(10050004)" valueOffset="0.0"
> phaseOffset="0.0" xHarmonic="0.0" normalizationFactor="1.0"/>
>
> I cannot see any (structural) difference in the tree lines.
>
>
> Can someone suggest a way to debug this?
Set a breakpoint on the XMIException's constructor. My guess is that
you have an ID reference that's resolving to the wrong type of object.
Perhaps you have more than one object with the same ID. This could
result in bidirectional reference inconsistencies that would lead to the
type of exception that you show at the bottom.
Note that when resource loading fails, it doesn't usually fail as badly
as you might think. I.e., if you call getResource a second time on the
resource set, you'll get back the resource with all the contents that it
was able to load. You could take this result and write it back out to
some other file location (resource.save with a stream argument) and then
you might do a text compare between that and what you read in. That
should show you what values have disappeared (and caused problems during
loading).
> I'm at a complete loss here.
> I can post the full model, if useful.
Please no. :-P
>
> Thanks in Advance
> Mauro
>
>
>
> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl$1DiagnosticWrappedException:
> org.eclipse.emf.ecore.xmi.IllegalValueException: Value
> 'com.voith.hyconmde.model.hyconmde.impl.SensorImpl@27aa8ff3 (id:
> 100029, eId: Sensor(100029), name: Clear, myStatus: VALID, status:
> VALID, decorator: null) (measureDirection: , valueOffset: 0.0,
> phaseOffset: 0.0, xHarmonic: 0.0, normalizationFactor: 1.0)' is not
> legal. (file:/C:/Users/mcon/.Voith/data/default.hyconmde, -1, -1)
> at
> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.handleDemandLoadException(ResourceSetImpl.java:319)
> at
> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLoadHelper(ResourceSetImpl.java:278)
> at
> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResource(ResourceSetImpl.java:406)
> at
> com.voith.hyconmde.core.AbstractModelService.getResource(AbstractModelService.java:154)
> at
> com.voith.hyconmde.core.AbstractModelService.getRoot(AbstractModelService.java:223)
> at com.voith.hyconmde.ui.VoithMDEApp$1.call(VoithMDEApp.java:149)
> at com.voith.hyconmde.ui.VoithMDEApp$1.call(VoithMDEApp.java:1)
> at javafx.concurrent.Task$TaskCallable.call(Task.java:1426)
> at java.util.concurrent.FutureTask.run(FutureTask.java:266)
> at java.lang.Thread.run(Thread.java:745)
> Caused by: org.eclipse.emf.ecore.xmi.IllegalValueException: Value
> 'com.voith.hyconmde.model.hyconmde.impl.SensorImpl@27aa8ff3 (id:
> 100029, eId: Sensor(100029), name: Clear, myStatus: VALID, status:
> VALID, decorator: null) (measureDirection: , valueOffset: 0.0,
> phaseOffset: 0.0, xHarmonic: 0.0, normalizationFactor: 1.0)' is not
> legal. (file:/C:/Users/mcon/.Voith/data/default.hyconmde, -1, -1)
> at
> org.eclipse.emf.ecore.xmi.impl.XMLHandler.setFeatureValue(XMLHandler.java:2671)
> at
> org.eclipse.emf.ecore.xmi.impl.XMLHandler.handleForwardReferences(XMLHandler.java:1156)
> at
> org.eclipse.emf.ecore.xmi.impl.XMLHandler.endDocument(XMLHandler.java:1235)
> at
> com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endDocument(AbstractSAXParser.java:745)
> at
> com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:515)
> at
> com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:848)
> at
> com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:777)
> at
> com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141)
> at
> com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1213)
> at
> com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:649)
> at
> com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl.parse(SAXParserImpl.java:333)
> at
> org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.load(XMLLoadImpl.java:175)
> at
> org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doLoad(XMLResourceImpl.java:253)
> at
> org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(ResourceImpl.java:1518)
> at
> org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(ResourceImpl.java:1297)
> at
> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLoad(ResourceSetImpl.java:259)
> at
> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLoadHelper(ResourceSetImpl.java:274)
> ... 8 more
> Caused by: java.lang.ArrayIndexOutOfBoundsException: -1
> at org.eclipse.emf.common.util.BasicEList.move(BasicEList.java:663)
> at
> org.eclipse.emf.common.notify.impl.NotifyingListImpl.doMove(NotifyingListImpl.java:1329)
> at
> org.eclipse.emf.common.notify.impl.NotifyingListImpl.move(NotifyingListImpl.java:1314)
> at
> org.eclipse.emf.common.util.AbstractEList.move(AbstractEList.java:533)
> at
> org.eclipse.emf.ecore.xmi.impl.XMLHelperImpl.setValue(XMLHelperImpl.java:1198)
> at
> org.eclipse.emf.ecore.xmi.impl.XMLHandler.setFeatureValue(XMLHandler.java:2666)
> ... 24 more
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Goto Forum:
Current Time: Tue Sep 24 16:29:55 GMT 2024
Powered by FUDForum. Page generated in 0.04184 seconds
|