You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tika.apache.org by "Hong-Thai Nguyen (JIRA)" <ji...@apache.org> on 2015/04/13 10:52:12 UTC

[jira] [Commented] (TIKA-1600) Unable to parse ODT files because of failed to close temporary resources

    [ https://issues.apache.org/jira/browse/TIKA-1600?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14492084#comment-14492084 ] 

Hong-Thai Nguyen commented on TIKA-1600:
----------------------------------------

The root exception is an NPE when parsing ODT files with elements in footnote:
{code}
java.lang.NullPointerException
	at org.apache.tika.parser.odf.OpenDocumentContentParser$OpenDocumentElementMappingContentHandler.startSpan(OpenDocumentContentParser.java:174)
	at org.apache.tika.parser.odf.OpenDocumentContentParser$OpenDocumentElementMappingContentHandler.startElement(OpenDocumentContentParser.java:287)
	at org.apache.tika.sax.ContentHandlerDecorator.startElement(ContentHandlerDecorator.java:126)
	at org.apache.tika.parser.odf.NSNormalizerContentHandler.startElement(NSNormalizerContentHandler.java:69)
	at org.apache.tika.sax.ContentHandlerDecorator.startElement(ContentHandlerDecorator.java:126)
	at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(AbstractSAXParser.java:501)
	at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:400)
	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2756)
	at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:647)
	at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:140)
	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:511)
	at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:808)
	at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)
	at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:119)
	at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1205)
	at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:522)
	at javax.xml.parsers.SAXParser.parse(SAXParser.java:395)
	at javax.xml.parsers.SAXParser.parse(SAXParser.java:198)
	at org.apache.tika.parser.odf.OpenDocumentContentParser.parseInternal(OpenDocumentContentParser.java:503)
	at org.apache.tika.parser.odf.OpenDocumentParser.handleZipEntry(OpenDocumentParser.java:187)
	at org.apache.tika.parser.odf.OpenDocumentParser.parse(OpenDocumentParser.java:164)
	at org.apache.tika.parser.odf.OpenDocumentParserTest.can_parse_odt_file(OpenDocumentParserTest.java:41)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
	at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
{code}

Seems that supporting style for ODF is recently added in 1.8:
{noformat}
Revision: 1666607
Author: tpalsulich
Date: samedi 14 mars 2015 00:25:53
Message:
TIKA-1063. Add basic ODF style support, contributed by Axel Dörfler.
----
Modified : /tika/trunk/CHANGES.txt
Modified : /tika/trunk/tika-parsers/src/main/java/org/apache/tika/parser/odf/OpenDocumentContentParser.java
Modified : /tika/trunk/tika-parsers/src/test/java/org/apache/tika/parser/odf/ODFParserTest.java
{noformat}

I've added a check NPE with Test in r1673138. [~tpalsulich], can you revise my commit, pls ?

> Unable to parse ODT files because of failed to close temporary resources
> ------------------------------------------------------------------------
>
>                 Key: TIKA-1600
>                 URL: https://issues.apache.org/jira/browse/TIKA-1600
>             Project: Tika
>          Issue Type: Bug
>          Components: parser
>    Affects Versions: 1.8
>         Environment: Windows
>            Reporter: Hong-Thai Nguyen
>         Attachments: Manuel_koha.odt
>
>
> Many ODT files are failed to parse causing of this exception. A sample file in attachment
> {code}
> Apache Tika was unable to parse the document
> at C:\Users\hong-thai.nguyen\Downloads\Manuel_koha.odt.
> The full exception stack trace is included below:
> org.apache.tika.exception.TikaException: Failed to close temporary resources
> 	at org.apache.tika.io.TemporaryResources.dispose(TemporaryResources.java:152)
> 	at org.apache.tika.parser.AutoDetectParser.parse(AutoDetectParser.java:127)
> 	at org.apache.tika.gui.TikaGUI.handleStream(TikaGUI.java:342)
> 	at org.apache.tika.gui.TikaGUI.openFile(TikaGUI.java:299)
> 	at org.apache.tika.gui.TikaGUI.actionPerformed(TikaGUI.java:256)
> 	at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
> 	at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
> 	at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
> 	at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
> 	at javax.swing.AbstractButton.doClick(Unknown Source)
> 	at javax.swing.plaf.basic.BasicMenuItemUI.doClick(Unknown Source)
> 	at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(Unknown Source)
> 	at java.awt.Component.processMouseEvent(Unknown Source)
> 	at javax.swing.JComponent.processMouseEvent(Unknown Source)
> 	at java.awt.Component.processEvent(Unknown Source)
> 	at java.awt.Container.processEvent(Unknown Source)
> 	at java.awt.Component.dispatchEventImpl(Unknown Source)
> 	at java.awt.Container.dispatchEventImpl(Unknown Source)
> 	at java.awt.Component.dispatchEvent(Unknown Source)
> 	at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
> 	at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
> 	at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
> 	at java.awt.Container.dispatchEventImpl(Unknown Source)
> 	at java.awt.Window.dispatchEventImpl(Unknown Source)
> 	at java.awt.Component.dispatchEvent(Unknown Source)
> 	at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
> 	at java.awt.EventQueue.access$400(Unknown Source)
> 	at java.awt.EventQueue$3.run(Unknown Source)
> 	at java.awt.EventQueue$3.run(Unknown Source)
> 	at java.security.AccessController.doPrivileged(Native Method)
> 	at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
> 	at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
> 	at java.awt.EventQueue$4.run(Unknown Source)
> 	at java.awt.EventQueue$4.run(Unknown Source)
> 	at java.security.AccessController.doPrivileged(Native Method)
> 	at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
> 	at java.awt.EventQueue.dispatchEvent(Unknown Source)
> 	at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
> 	at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
> 	at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
> 	at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
> 	at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
> 	at java.awt.EventDispatchThread.run(Unknown Source)
> Caused by: java.io.IOException: Could not delete temporary file C:\Users\HONG-T~1.NGU\AppData\Local\Temp\apache-tika-2891340188156641845.tmp
> 	at org.apache.tika.io.TemporaryResources$1.close(TemporaryResources.java:70)
> 	at org.apache.tika.io.TemporaryResources.close(TemporaryResources.java:121)
> 	at org.apache.tika.io.TemporaryResources.dispose(TemporaryResources.java:150)
> 	... 42 more
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)