Uploaded image for project: 'Tika'
  1. Tika
  2. TIKA-1070

StackOverflow error in org.apache.tika.sax.ToXMLContentHandler$ElementInfo.getPrefix(ToXMLContentHandler.java:58)

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.2, 1.3
    • 1.5
    • parser
    • None
    • Java

    Description

      The error occurs when parsing big "XLS" files and is caused by the ElementInfo stored in "currentElement".

      Each time a new element is started (method startElement) the current elment is newly overwritten with

      currentElement = new ElementInfo(currentElement, namespaces);

      where the existing element is used as the parent element. Since the currentElement is not reset to the parent element after finishing the element (method: endElement) the method getPrefix recursively traverses the parents and finally causes the StackOverFlowError

      For my understanding: something like:

      currentElement = currentElement.parent;

      in the endElement method solves the issue!

      Best

      Attachments

        1. ToXMLContentHandler.java.patch
          0.6 kB
          Dietmar Glachs

        Activity

          People

            Unassigned Unassigned
            dglachs Dietmar Glachs
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: