I am passing a file as input stream to parser.parse() method while using
apache tika library to convert file to text.The method throws an exception
(displayed below) but the input stream is closed in the finally block
successfully. Then while renaming the file, the File.renameTo method from
java.io returns false. I am not able to rename/delete/move the file despite
successfully closing the inputStream. I am afraid another instance of file
is created, while parser.parse() method processess the file, which doesn't
get closed till the time exception is throw. Is that possible? If so what
should I do to rename or delete the file.

The Exception thrown while checking the content type is

java.lang.NoClassDefFoundError: Could not initialize class
com.adobe.xmp.impl.XMPMetaParser
at com.adobe.xmp.XMPMetaFactory.parseFromBuffer(XMPMetaFactory.java:160)
at com.adobe.xmp.XMPMetaFactory.parseFromBuffer(XMPMetaFactory.java:144)
at com.drew.metadata.xmp.XmpReader.extract(XmpReader.java:106)
at
com.drew.imaging.jpeg.JpegMetadataReader.extractMetadataFromJpegSegmentReader(JpegMetadataReader.java:112)
at
com.drew.imaging.jpeg.JpegMetadataReader.readMetadata(JpegMetadataReader.java:71)
    
at
org.apache.tika.parser.image.ImageMetadataExtractor.parseJpeg(ImageMetadataExtractor.java:91)
 
at org.apache.tika.parser.jpeg.JpegParser.parse(JpegParser.java:56)
at org.apache.tika.parser.CompositeParser.parse(CompositeParser.java:244)
at org.apache.tika.parser.CompositeParser.parse(CompositeParser.java:244)
at org.apache.tika.parser.AutoDetectParser.parse(AutoDetectParser.java:121)



--
View this message in context: 
http://lucene.472066.n3.nabble.com/parser-parse-throws-exception-after-which-the-procesed-file-is-not-getting-renamed-moved-tp4165153.html
Sent from the Apache Tika - Development mailing list archive at Nabble.com.

Reply via email to