Bug #3405

CQP Annotation, segment-category-value, can't delete some annotations

Added by Matthieu Decorde 6 months ago. Updated 5 months ago.

Status:New Start date:06/19/2023
Priority:Normal Due date:
Assignee:- % Done:

80%

Category:Annotation Spent time: -
Target version:TXM 0.8.3

Description

The write annotations step seems to fail when there are some superposed annotations (of different type)

Error log:

Enregistrement de 1 annotations...
[test2[198-199]=#del]
[]
Unexpected error while parsing file file:/home/xyz/runtime-rcpapplication.product/corpora/VOEUX/txm/VOEUX/0001.xml : javax.xml.stream.XMLStreamException: No element was found to write: java.lang.ArrayIndexOutOfBoundsException: Index -1 out of bounds for length 10
Location line: 643 character: 31
javax.xml.stream.XMLStreamException: No element was found to write: java.lang.ArrayIndexOutOfBoundsException: Index -1 out of bounds for length 10
    at java.xml/com.sun.xml.internal.stream.writers.XMLStreamWriterImpl.writeEndElement(XMLStreamWriterImpl.java:962)
    at org.txm.importer.StaxIdentityParser.processEndElement(StaxIdentityParser.java:487)
    at org.txm.annotation.kr.core.AnnotationInjector.processEndElement(AnnotationInjector.java:529)
    at org.txm.importer.StaxIdentityParser.process(StaxIdentityParser.java:257)
    at org.txm.importer.StaxIdentityParser.process(StaxIdentityParser.java:151)
    at org.txm.importer.StaxIdentityParser.process(StaxIdentityParser.java:144)
    at org.txm.annotation.kr.core.AnnotationWriter.writeAnnotationsInFile(AnnotationWriter.java:295)
    at org.txm.annotation.kr.core.AnnotationWriter.writeAnnotations(AnnotationWriter.java:260)
    at org.txm.annotation.kr.core.AnnotationManager.saveAnnotations(AnnotationManager.java:82)
    at org.txm.annotation.kr.rcp.commands.SaveAnnotations$1.run(SaveAnnotations.java:72)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)
Caused by: java.lang.ArrayIndexOutOfBoundsException: Index -1 out of bounds for length 10
    at java.xml/com.sun.xml.internal.stream.writers.XMLStreamWriterImpl$ElementStack.pop(XMLStreamWriterImpl.java:2027)
    at java.xml/com.sun.xml.internal.stream.writers.XMLStreamWriterImpl.writeEndElement(XMLStreamWriterImpl.java:935)
    ... 10 more 

Solution

Fix the AnnotationsWriter & AnnotationInjection class implementing the solution of https://groupes.renater.fr/wiki/txm-info/public/annotation/specs_manual_annotation/specs_store_annotation#sauvegarde_definitive "Encodage XML des annotations" section

History

#1 Updated by Matthieu Decorde 6 months ago

  • % Done changed from 0 to 80

XML fixed but more fixes to do later

#2 Updated by Matthieu Decorde 5 months ago

  • Description updated (diff)

#3 Updated by Matthieu Decorde 5 months ago

  • Description updated (diff)

Also available in: Atom PDF