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

ContentHandlerDecorator outputs invalid element

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.0, 1.1
    • 1.1
    • None
    • None

    Description

      • Start Tika GUI
      • try opening test-outlook.msg (from tika-parsers test resources)
      • the following exception is thrown:
        org.apache.tika.exception.TikaException: Unexpected RuntimeException from org.apache.tika.parser.microsoft.OfficeParser@12e14ebc
        	at org.apache.tika.parser.CompositeParser.parse(CompositeParser.java:245)
        	at org.apache.tika.parser.CompositeParser.parse(CompositeParser.java:243)
        	at org.apache.tika.parser.AutoDetectParser.parse(AutoDetectParser.java:120)
        	at org.apache.tika.gui.TikaGUI.handleStream(TikaGUI.java:320)
        	at org.apache.tika.gui.TikaGUI.openFile(TikaGUI.java:279)
        	at org.apache.tika.gui.TikaGUI.actionPerformed(TikaGUI.java:238)
        	at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2028)
        	at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2351)
        	at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
        	at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
        	at javax.swing.AbstractButton.doClick(AbstractButton.java:389)
        	at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:809)
        	at com.apple.laf.AquaMenuItemUI.doClick(AquaMenuItemUI.java:137)
        	at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.java:850)
        	at java.awt.Component.processMouseEvent(Component.java:6373)
        	at javax.swing.JComponent.processMouseEvent(JComponent.java:3267)
        	at java.awt.Component.processEvent(Component.java:6138)
        	at java.awt.Container.processEvent(Container.java:2085)
        	at java.awt.Component.dispatchEventImpl(Component.java:4735)
        	at java.awt.Container.dispatchEventImpl(Container.java:2143)
        	at java.awt.Component.dispatchEvent(Component.java:4565)
        	at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4621)
        	at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4282)
        	at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4212)
        	at java.awt.Container.dispatchEventImpl(Container.java:2129)
        	at java.awt.Window.dispatchEventImpl(Window.java:2478)
        	at java.awt.Component.dispatchEvent(Component.java:4565)
        	at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:679)
        	at java.awt.EventQueue.access$000(EventQueue.java:85)
        	at java.awt.EventQueue$1.run(EventQueue.java:638)
        	at java.awt.EventQueue$1.run(EventQueue.java:636)
        	at java.security.AccessController.doPrivileged(Native Method)
        	at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
        	at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:98)
        	at java.awt.EventQueue$2.run(EventQueue.java:652)
        	at java.awt.EventQueue$2.run(EventQueue.java:650)
        	at java.security.AccessController.doPrivileged(Native Method)
        	at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
        	at java.awt.EventQueue.dispatchEvent(EventQueue.java:649)
        	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:296)
        	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:211)
        	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:201)
        	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:196)
        	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:188)
        	at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
        Caused by: java.lang.NullPointerException
        	at com.sun.org.apache.xml.internal.serializer.ToHTMLStream.endElement(ToHTMLStream.java:907)
        	at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerHandlerImpl.endElement(TransformerHandlerImpl.java:273)
        	at org.apache.tika.sax.ContentHandlerDecorator.endElement(ContentHandlerDecorator.java:136)
        	at org.apache.tika.gui.TikaGUI$2.endElement(TikaGUI.java:519)
        	at org.apache.tika.sax.TeeContentHandler.endElement(TeeContentHandler.java:94)
        	at org.apache.tika.sax.ContentHandlerDecorator.endElement(ContentHandlerDecorator.java:136)
        	at org.apache.tika.sax.SecureContentHandler.endElement(SecureContentHandler.java:256)
        	at org.apache.tika.sax.ContentHandlerDecorator.endElement(ContentHandlerDecorator.java:136)
        	at org.apache.tika.sax.ContentHandlerDecorator.endElement(ContentHandlerDecorator.java:136)
        	at org.apache.tika.sax.ContentHandlerDecorator.endElement(ContentHandlerDecorator.java:136)
        	at org.apache.tika.sax.SafeContentHandler.endElement(SafeContentHandler.java:273)
        	at org.apache.tika.sax.XHTMLContentHandler.endDocument(XHTMLContentHandler.java:213)
        	at org.apache.tika.parser.microsoft.OfficeParser.parse(OfficeParser.java:159)
        	at org.apache.tika.parser.CompositeParser.parse(CompositeParser.java:243)
        	... 44 more
        

      The same file is parsed without any errors when not in GUI mode.

      Attachments

        1. FW Testing.msg
          25 kB
          Paul Hill
        2. TIKA-801.patch
          5 kB
          Michael McCandless

        Activity

          People

            mikemccand Michael McCandless
            ab Andrzej Bialecki
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: