[jira] [Commented] (TIKA-1732) TikaException "Failed to close temporary resources" with AutoDetectParser on Windows

2015-09-09 Thread Tim Allison (JIRA)

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

Tim Allison commented on TIKA-1732:
---

Any chance there's an old version of POI on your class path?

How are you importing the dependencies? via POM+maven?  Or another mechanism?

> TikaException "Failed to close temporary resources" with AutoDetectParser on 
> Windows
> 
>
> Key: TIKA-1732
> URL: https://issues.apache.org/jira/browse/TIKA-1732
> Project: Tika
>  Issue Type: Bug
>  Components: core
>Affects Versions: 1.10
> Environment: Windows 8.1 Pro, Java 1.8.0_45
>Reporter: Assaf Urieli
> Attachments: test.docx
>
>
> When running the very basic example on 
> https://tika.apache.org/1.7/examples.html
> The following exception is thrown:
> Exception in thread "main" 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.parser.AutoDetectParser.parse(AutoDetectParser.java:136)
>   at 
> com.joliciel.test.tika.TikaStructureTest.main(TikaStructureTest.java:17)
> Caused by: java.io.IOException: Could not delete temporary file 
> C:\Users\Assaf\AppData\Local\Temp\apache-tika-1485913318469340881.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)
>   ... 3 more
> The code is:
> import java.io.InputStream;
> import org.apache.tika.metadata.Metadata;
> import org.apache.tika.parser.AutoDetectParser;
> import org.apache.tika.sax.BodyContentHandler;
> public class TikaTest {
>   public static void main(String[] args) throws Exception {
>   InputStream stream = 
> TikaTest.class.getResourceAsStream("test.docx");
>   BodyContentHandler handler = new BodyContentHandler();
>   AutoDetectParser parser = new AutoDetectParser();
>   Metadata metadata = new Metadata();
>   try {
>   parser.parse(stream, handler, metadata);
>   System.out.println(handler.toString());
>   } finally {
>   stream.close();
>   }
>   }
> }
> The file analysed is a Microsoft Word 2013 DOCX.



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


[jira] [Commented] (TIKA-1732) TikaException "Failed to close temporary resources" with AutoDetectParser on Windows

2015-09-09 Thread Tim Allison (JIRA)

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

Tim Allison commented on TIKA-1732:
---

Odd...What happens if you call TikaInputStream.get() on the actual file instead 
of the getResourceAsStream?

Same behavior with a different file format (e.g. "doc")?

I have no doubt that you are seeing this, but I'm not able to replicate it on 
Windows 7 with java 1.8.0_60-b27.



> TikaException "Failed to close temporary resources" with AutoDetectParser on 
> Windows
> 
>
> Key: TIKA-1732
> URL: https://issues.apache.org/jira/browse/TIKA-1732
> Project: Tika
>  Issue Type: Bug
>  Components: core
>Affects Versions: 1.10
> Environment: Windows 8.1 Pro, Java 1.8.0_45
>Reporter: Assaf Urieli
> Attachments: test.docx
>
>
> When running the very basic example on 
> https://tika.apache.org/1.7/examples.html
> The following exception is thrown:
> Exception in thread "main" 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.parser.AutoDetectParser.parse(AutoDetectParser.java:136)
>   at 
> com.joliciel.test.tika.TikaStructureTest.main(TikaStructureTest.java:17)
> Caused by: java.io.IOException: Could not delete temporary file 
> C:\Users\Assaf\AppData\Local\Temp\apache-tika-1485913318469340881.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)
>   ... 3 more
> The code is:
> import java.io.InputStream;
> import org.apache.tika.metadata.Metadata;
> import org.apache.tika.parser.AutoDetectParser;
> import org.apache.tika.sax.BodyContentHandler;
> public class TikaTest {
>   public static void main(String[] args) throws Exception {
>   InputStream stream = 
> TikaTest.class.getResourceAsStream("test.docx");
>   BodyContentHandler handler = new BodyContentHandler();
>   AutoDetectParser parser = new AutoDetectParser();
>   Metadata metadata = new Metadata();
>   try {
>   parser.parse(stream, handler, metadata);
>   System.out.println(handler.toString());
>   } finally {
>   stream.close();
>   }
>   }
> }
> The file analysed is a Microsoft Word 2013 DOCX.



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


[jira] [Commented] (TIKA-1732) TikaException "Failed to close temporary resources" with AutoDetectParser on Windows

2015-09-09 Thread Assaf Urieli (JIRA)

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

Assaf Urieli commented on TIKA-1732:


Thanks for the hints - there was definitely something additional on the 
classpath that was breaking this.
When I moved my test to a project with only the JRE and tika-app-1.10.jar on 
the classpath, it works.
I'll try to figure out what the conflict was and report back. Meanwhile, this 
issue can be considered closed.
Sorry for the bother!

> TikaException "Failed to close temporary resources" with AutoDetectParser on 
> Windows
> 
>
> Key: TIKA-1732
> URL: https://issues.apache.org/jira/browse/TIKA-1732
> Project: Tika
>  Issue Type: Bug
>  Components: core
>Affects Versions: 1.10
> Environment: Windows 8.1 Pro, Java 1.8.0_45
>Reporter: Assaf Urieli
> Attachments: test.docx
>
>
> When running the very basic example on 
> https://tika.apache.org/1.7/examples.html
> The following exception is thrown:
> Exception in thread "main" 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.parser.AutoDetectParser.parse(AutoDetectParser.java:136)
>   at 
> com.joliciel.test.tika.TikaStructureTest.main(TikaStructureTest.java:17)
> Caused by: java.io.IOException: Could not delete temporary file 
> C:\Users\Assaf\AppData\Local\Temp\apache-tika-1485913318469340881.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)
>   ... 3 more
> The code is:
> import java.io.InputStream;
> import org.apache.tika.metadata.Metadata;
> import org.apache.tika.parser.AutoDetectParser;
> import org.apache.tika.sax.BodyContentHandler;
> public class TikaTest {
>   public static void main(String[] args) throws Exception {
>   InputStream stream = 
> TikaTest.class.getResourceAsStream("test.docx");
>   BodyContentHandler handler = new BodyContentHandler();
>   AutoDetectParser parser = new AutoDetectParser();
>   Metadata metadata = new Metadata();
>   try {
>   parser.parse(stream, handler, metadata);
>   System.out.println(handler.toString());
>   } finally {
>   stream.close();
>   }
>   }
> }
> The file analysed is a Microsoft Word 2013 DOCX.



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


[jira] [Commented] (TIKA-1732) TikaException "Failed to close temporary resources" with AutoDetectParser on Windows

2015-09-09 Thread Assaf Urieli (JIRA)

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

Assaf Urieli commented on TIKA-1732:


In case anybody else runs into this, the conflicting JAR was a version of GNU 
JAXP (gnujaxp.jar). I'm not sure which version, as there is no version 
information included in the JAR.

> TikaException "Failed to close temporary resources" with AutoDetectParser on 
> Windows
> 
>
> Key: TIKA-1732
> URL: https://issues.apache.org/jira/browse/TIKA-1732
> Project: Tika
>  Issue Type: Bug
>  Components: core
>Affects Versions: 1.10
> Environment: Windows 8.1 Pro, Java 1.8.0_45
>Reporter: Assaf Urieli
> Attachments: test.docx
>
>
> When running the very basic example on 
> https://tika.apache.org/1.7/examples.html
> The following exception is thrown:
> Exception in thread "main" 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.parser.AutoDetectParser.parse(AutoDetectParser.java:136)
>   at 
> com.joliciel.test.tika.TikaStructureTest.main(TikaStructureTest.java:17)
> Caused by: java.io.IOException: Could not delete temporary file 
> C:\Users\Assaf\AppData\Local\Temp\apache-tika-1485913318469340881.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)
>   ... 3 more
> The code is:
> import java.io.InputStream;
> import org.apache.tika.metadata.Metadata;
> import org.apache.tika.parser.AutoDetectParser;
> import org.apache.tika.sax.BodyContentHandler;
> public class TikaTest {
>   public static void main(String[] args) throws Exception {
>   InputStream stream = 
> TikaTest.class.getResourceAsStream("test.docx");
>   BodyContentHandler handler = new BodyContentHandler();
>   AutoDetectParser parser = new AutoDetectParser();
>   Metadata metadata = new Metadata();
>   try {
>   parser.parse(stream, handler, metadata);
>   System.out.println(handler.toString());
>   } finally {
>   stream.close();
>   }
>   }
> }
> The file analysed is a Microsoft Word 2013 DOCX.



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


[jira] [Commented] (TIKA-1732) TikaException "Failed to close temporary resources" with AutoDetectParser on Windows

2015-09-09 Thread Tim Allison (JIRA)

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

Tim Allison commented on TIKA-1732:
---

NP.  Thank you for closing the loop!

Your test doc made me realize that we aren't calculating autocounted header 
numbers in our output...will add that to a todo list...at some point. ;)

Cheers.

> TikaException "Failed to close temporary resources" with AutoDetectParser on 
> Windows
> 
>
> Key: TIKA-1732
> URL: https://issues.apache.org/jira/browse/TIKA-1732
> Project: Tika
>  Issue Type: Bug
>  Components: core
>Affects Versions: 1.10
> Environment: Windows 8.1 Pro, Java 1.8.0_45
>Reporter: Assaf Urieli
> Attachments: test.docx
>
>
> When running the very basic example on 
> https://tika.apache.org/1.7/examples.html
> The following exception is thrown:
> Exception in thread "main" 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.parser.AutoDetectParser.parse(AutoDetectParser.java:136)
>   at 
> com.joliciel.test.tika.TikaStructureTest.main(TikaStructureTest.java:17)
> Caused by: java.io.IOException: Could not delete temporary file 
> C:\Users\Assaf\AppData\Local\Temp\apache-tika-1485913318469340881.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)
>   ... 3 more
> The code is:
> import java.io.InputStream;
> import org.apache.tika.metadata.Metadata;
> import org.apache.tika.parser.AutoDetectParser;
> import org.apache.tika.sax.BodyContentHandler;
> public class TikaTest {
>   public static void main(String[] args) throws Exception {
>   InputStream stream = 
> TikaTest.class.getResourceAsStream("test.docx");
>   BodyContentHandler handler = new BodyContentHandler();
>   AutoDetectParser parser = new AutoDetectParser();
>   Metadata metadata = new Metadata();
>   try {
>   parser.parse(stream, handler, metadata);
>   System.out.println(handler.toString());
>   } finally {
>   stream.close();
>   }
>   }
> }
> The file analysed is a Microsoft Word 2013 DOCX.



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