Uploaded image for project: 'Tika'
  1. Tika
  2. TIKA-2987

Extracting Metadata from JPEG Fails with Tika Bundle

    XMLWordPrintableJSON

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Major
    • Resolution: Not A Problem
    • Affects Version/s: 1.21
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      When attempting to extract metadata from a JPEG image with Tika OSGi Bundle, it fails with the following exception:

      18.11.2019 14:57:26.000 *ERROR* [oak-executor-37] org.apache.jackrabbit.oak.plugins.observation.FilteringDispatcher Uncaught exception in org.apache.jackrabbit.oak.plugins.observation.FilteringDispatcher@139d97c618.11.2019 14:57:26.000 *ERROR* [oak-executor-37] org.apache.jackrabbit.oak.plugins.observation.FilteringDispatcher Uncaught exception in org.apache.jackrabbit.oak.plugins.observation.FilteringDispatcher@139d97c6java.lang.NoClassDefFoundError: com/drew/imaging/jpeg/JpegProcessingException at org.apache.tika.parser.jpeg.JpegParser.parse(JpegParser.java:58) at org.apache.tika.parser.CompositeParser.parse(CompositeParser.java:280) [org.apache.tika.core:1.22.0] at org.apache.tika.parser.CompositeParser.parse(CompositeParser.java:280) [org.apache.tika.core:1.22.0] at org.apache.tika.parser.CompositeParser.parse(CompositeParser.java:280) [org.apache.tika.core:1.22.0] at org.apache.tika.parser.AutoDetectParser.parse(AutoDetectParser.java:143) [org.apache.tika.core:1.22.0] at org.apache.sling.cms.core.internal.FileMetadataExtractorImpl.extractMetadata(FileMetadataExtractorImpl.java:148) [org.apache.sling.cms.core:0.12.1.SNAPSHOT] at org.apache.sling.cms.core.internal.FileMetadataExtractorImpl.updateMetadata(FileMetadataExtractorImpl.java:123) [org.apache.sling.cms.core:0.12.1.SNAPSHOT] at org.apache.sling.cms.core.internal.listeners.FileMetadataExtractorListener.handleChange(FileMetadataExtractorListener.java:59) [org.apache.sling.cms.core:0.12.1.SNAPSHOT] at org.apache.sling.cms.core.internal.listeners.FileMetadataExtractorListener.onChange(FileMetadataExtractorListener.java:74) [org.apache.sling.cms.core:0.12.1.SNAPSHOT] at org.apache.sling.resourceresolver.impl.observation.BasicObservationReporter.reportChanges(BasicObservationReporter.java:211) [org.apache.sling.resourceresolver:1.6.14] at org.apache.sling.jcr.resource.internal.JcrResourceListener.onEvent(JcrResourceListener.java:155) [org.apache.sling.jcr.resource:3.0.18] at org.apache.jackrabbit.commons.observation.ListenerTracker$1.onEvent(ListenerTracker.java:190) [org.apache.jackrabbit.jackrabbit-jcr-commons:2.18.2] at org.apache.jackrabbit.oak.jcr.observation.ChangeProcessor.contentChanged(ChangeProcessor.java:513) [org.apache.jackrabbit.oak-jcr:1.16.0] at org.apache.jackrabbit.oak.plugins.observation.FilteringDispatcher.contentChanged(FilteringDispatcher.java:52) [org.apache.jackrabbit.oak-core:1.16.0] at org.apache.jackrabbit.oak.spi.commit.BackgroundObserver$1$1.call(BackgroundObserver.java:127) [org.apache.jackrabbit.oak-store-spi:1.16.0] at org.apache.jackrabbit.oak.spi.commit.BackgroundObserver$1$1.call(BackgroundObserver.java:121) [org.apache.jackrabbit.oak-store-spi:1.16.0] at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748)Caused by: java.lang.ClassNotFoundException: com.drew.imaging.jpeg.JpegProcessingException not found by org.apache.tika.parsers [67] at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1597) at org.apache.felix.framework.BundleWiringImpl.access$300(BundleWiringImpl.java:79) at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:1982) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ... 20 common frames omitted
      

      It seems to have something to do with the way the Drew Noakes MetadaExtractor is embedded into the Tika Bundle. I have tried supplying the metadata extractor as a separate bundle, even including the Adobe XMP Core inline and Tika does fails with the same issue.

      You can reproduce the issue in theĀ [Apache Sling CMS|https://github.com/apache/sling-org-apache-sling-app-cms] by starting the app, uploading a JPEG file and seeing the log at sling/logs/error.log

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              klcodanr Dan Klco
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: