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

John Mastarone commented on TIKA-853:
-------------------------------------

I had added my temporary folder and tika project folder to my virus scanner's 
exclusion list; it didn't help.  Inside the Tika MP4Parser class's parse 
method, I added a catch block that would print out any exceptions caught.  I 
removed the two lines:
isoFile = new IsoFile(isoBufferWrapper);
isoFile.parse();
and still had my same exception.  I then removed the preceding line:
IsoBufferWrapper isoBufferWrapper =  new IsoBufferWrapperImpl( 
tstream.getFile());
and replaced it with just "tstream.getFile();".  Then, when parsing, I no 
longer had my exception caused by tstream.close() in the finally block---I had 
another one later on in the method, related to the fact that I'd removed those 
lines concerning the external parser classes.  At no time did I ever catch any 
exception from these external parser classes with my added catch block.  The 
IsoBufferWrapperImpl itself creates an internal RandomAccessFile, but it should 
close it at the end of its constructor, or else throw an exception that I 
should be seeing.  But anyway, without yet stepping through that external 
source code while debugging to see if something obvious is going wrong, just 
the act of creating that IsoBufferWrapperImpl prevents the temporary file from 
being deleted, I think.  I don't see any methods on the isoFile or the 
isoBufferWrapper objects that might help release something that needs to be 
released.  
                
> java.io.IOException with TikaGUI and testMP4.m4a
> ------------------------------------------------
>
>                 Key: TIKA-853
>                 URL: https://issues.apache.org/jira/browse/TIKA-853
>             Project: Tika
>          Issue Type: Bug
>          Components: gui, parser
>    Affects Versions: 1.1
>         Environment: Windows 7
>            Reporter: John Mastarone
>
> Using a latest build: when attempting to drop the new testMP4.m4a file into 
> the Tika GUI, a TikaException / IOException occurs:  
> 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:320)
>       at org.apache.tika.gui.TikaGUI.openFile(TikaGUI.java:279)
>       at 
> org.apache.tika.gui.ParsingTransferHandler.importFiles(ParsingTransferHandler.java:94)
>       at 
> org.apache.tika.gui.ParsingTransferHandler.importData(ParsingTransferHandler.java:77)
>       at javax.swing.TransferHandler.importData(Unknown Source)
>       at javax.swing.TransferHandler$DropHandler.drop(Unknown Source)
> ....
> Caused by: java.io.IOException: Could not delete temporary file 
> C:\Users\john\AppData\Local\Temp\apache-tika-693752014807275949.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)
>       ... 40 more
> I know that the parser for this file is new and its external source parser 
> has some potential bugs, but this exception does not occur when using Tika 
> CLI to detect / parse the test file.  

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to