You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tika.apache.org by "Magnus Lövgren (JIRA)" <ji...@apache.org> on 2013/02/01 09:15:13 UTC

[jira] [Commented] (TIKA-1068) Metadata-extractor throws NoSuchMethodError for jpg image with xmp header data

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

Magnus Lövgren commented on TIKA-1068:
--------------------------------------

This is NOT general bug, but obviously there are "bad" metadata-extractor:2.6.2 jars in the wild, watch out!

We had a bad jar in our Artifactory. It all works now when it is replaced with the one suggested by Ray Gauss II, see: [1] above.

Thanks for all help Ray, much appreciated. I'll resolve and close this issue.


                
> Metadata-extractor throws NoSuchMethodError for jpg image with xmp header data
> ------------------------------------------------------------------------------
>
>                 Key: TIKA-1068
>                 URL: https://issues.apache.org/jira/browse/TIKA-1068
>             Project: Tika
>          Issue Type: Bug
>          Components: parser
>    Affects Versions: 1.3
>            Reporter: Magnus Lövgren
>            Priority: Critical
>         Attachments: vinter080501-66.jpg
>
>
> Using Tika 1.3, parsing of jpg files throws NoSuchMethodError when the jpg contains xmp data. No Error was thrown in Tika 1.2.
> The metadata-extractor was updated in Tika 1.3 (to "com.drewnoakes:metadata-extractor:2.6.2"), See TIKA-811 (duplicated by TIKA-996). That jar is badly compiled (as mentioned by Emmanuel Hugonnet as comment on TIKA-915) and causes the NoSuchMethodError!
> => the metadata-extractor 2.6.2 jar needs to be replaced! Problem seems fixed in metadata-extractor 2.7.0, but that isn't released yet.
> Discussions available at:
> http://code.google.com/p/metadata-extractor/issues/detail?id=39
> http://code.google.com/p/metadata-extractor/issues/detail?id=55
> Code to reproduce problem:
> =========================
> <dependency>
> 	<groupId>org.apache.tika</groupId>
> 	<artifactId>tika-core</artifactId>
> 	<version>1.3</version>
> </dependency>
> <dependency>
> 	<groupId>org.apache.tika</groupId>
> 	<artifactId>tika-xmp</artifactId>
> 	<version>1.3</version>
> </dependency>
> <dependency>
> 	<groupId>org.apache.tika</groupId>
> 	<artifactId>tika-parsers</artifactId>
> 	<version>1.3</version>
> </dependency>
> InputStream inputStream = ... // vinter080501-66.jpg file (attached)
> ContentHandler contentHandler = new BodyContentHandler(2000000);
> Metadata metadata = new Metadata();
> ParseContext context = new ParseContext();
> Parser parser = new AutoDetectParser();
> parser.parse(inputStream, contentHandler, metadata, context); // Throws NoSuchMethodError
> => java.lang.NoSuchMethodError: com.adobe.xmp.properties.XMPPropertyInfo.getValue()Ljava/lang/Object;
> 	at com.drew.metadata.xmp.XmpReader.extract(Unknown Source)
> 	at com.drew.imaging.jpeg.JpegMetadataReader.extractMetadataFromJpegSegmentReader(Unknown Source)
> 	at com.drew.imaging.jpeg.JpegMetadataReader.readMetadata(Unknown Source)
> 	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:242)
> 	at org.apache.tika.parser.CompositeParser.parse(CompositeParser.java:242)
> 	at org.apache.tika.parser.AutoDetectParser.parse(AutoDetectParser.java:120)

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira