Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-120596

Resolve Apache Tika and commons-codec transitive dependency issue

Details

    Description

      Issue
      We currently use Apache Tika 1.19 (LPS-88839) which requires commons-codec:commons-codec:1.11. However, this dependency was never updated alongside with Apache Tika, which can cause it to be out of sync.

      Context
      Our customer opened up a request reporting a stack trace that indicates the following which seems to demonstrate that Apache Tika is trying to reference the existing commons-codec which is missing a method (because it's outdated):

      2020-08-28 10:41:47,012 ip-10-54-19-28.ap-southeast-2.compute.internal ERROR [liferay/background_task-1][FileImpl:?] java.lang.NoSuchMethodError: 'java.lang.String org.apache.commons.codec.binary.Hex.encodeHexString(byte[], boolean)'
      java.lang.NoSuchMethodError: 'java.lang.String org.apache.commons.codec.binary.Hex.encodeHexString(byte[], boolean)'
      	at org.apache.poi.hpsf.ClassID.toString(ClassID.java:313)
      	at org.apache.tika.parser.microsoft.AbstractPOIFSExtractor.handleEmbeddedOfficeDoc(AbstractPOIFSExtractor.java:184)
      	at org.apache.tika.parser.microsoft.AbstractPOIFSExtractor.handleEmbeddedOfficeDoc(AbstractPOIFSExtractor.java:146)
      	at org.apache.tika.parser.microsoft.WordExtractor.parse(WordExtractor.java:229)
      	at org.apache.tika.parser.microsoft.OfficeParser.parse(OfficeParser.java:175)
      	at org.apache.tika.parser.microsoft.OfficeParser.parse(OfficeParser.java:131)
      	at org.apache.tika.parser.CompositeParser.parse(CompositeParser.java:280)
      	at org.apache.tika.parser.CompositeParser.parse(CompositeParser.java:280)
      	at org.apache.tika.parser.AutoDetectParser.parse(AutoDetectParser.java:143)
      	at org.apache.tika.Tika.parseToString(Tika.java:527)
      	at com.liferay.portal.util.FileImpl._parseToString(FileImpl.java:1134)
      	at com.liferay.portal.util.FileImpl.extractText(FileImpl.java:447)
      	at com.liferay.portal.kernel.util.FileUtil.extractText(FileUtil.java:163)
      	at com.liferay.portal.kernel.search.DocumentImpl.addFile(DocumentImpl.java:201)
      	at com.liferay.document.library.internal.search.spi.model.index.contributor.DLFileEntryModelDocumentContributor.contribute(DLFileEntryModelDocumentContributor.java:115)
      	at com.liferay.document.library.internal.search.spi.model.index.contributor.DLFileEntryModelDocumentContributor.contribute(DLFileEntryModelDocumentContributor.java:61)
      	at com.liferay.portal.search.internal.indexer.IndexerDocumentBuilderImpl.lambda$getDocument$1(IndexerDocumentBuilderImpl.java:60)
      	at java.base/java.lang.Iterable.forEach(Iterable.java:75)
      	at com.liferay.portal.search.internal.indexer.IndexerDocumentBuilderImpl.getDocument(IndexerDocumentBuilderImpl.java:58)
      	at com.liferay.portal.search.internal.index.contributor.helper.ModelIndexerWriterDocumentHelperImpl.getDocument(ModelIndexerWriterDocumentHelperImpl.java:41)
      	at com.liferay.document.library.internal.search.spi.model.index.contributor.DLFileEntryModelIndexerWriterContributor.lambda$customize$0(DLFileEntryModelIndexerWriterContributor.java:57)
      	at com.liferay.portal.search.internal.batch.DynamicQueryBatchIndexingActionableAdapter.lambda$setPerformActionMethod$0(DynamicQueryBatchIndexingActionableAdapter.java:75)
      	at com.liferay.portal.kernel.dao.orm.DefaultActionableDynamicQuery.performAction(DefaultActionableDynamicQuery.java:394)
      	at com.liferay.portal.kernel.dao.orm.DefaultActionableDynamicQuery$1.call(DefaultActionableDynamicQuery.java:306)
      	at com.liferay.portal.kernel.dao.orm.DefaultActionableDynamicQuery$1.call(DefaultActionableDynamicQuery.java:268)
      	at com.liferay.portal.kernel.dao.orm.DefaultActionableDynamicQuery.doPerformActions(DefaultActionableDynamicQuery.java:326)
      	at com.liferay.portal.kernel.dao.orm.IndexableActionableDynamicQuery.doPerformActions(IndexableActionableDynamicQuery.java:107)
      	at com.liferay.portal.kernel.dao.orm.DefaultActionableDynamicQuery.performActions(DefaultActionableDynamicQuery.java:86)
      	at com.liferay.portal.kernel.dao.orm.IndexableActionableDynamicQuery.performActions(IndexableActionableDynamicQuery.java:65)
      	at com.liferay.portal.search.internal.batch.DynamicQueryBatchIndexingActionableAdapter.performActions(DynamicQueryBatchIndexingActionableAdapter.java:50)
      	at com.liferay.portal.search.internal.indexer.IndexerWriterImpl.reindex(IndexerWriterImpl.java:199)
      	at com.liferay.portal.search.internal.indexer.DefaultIndexer.reindex(DefaultIndexer.java:267)
      	at com.liferay.portal.search.internal.background.task.ReindexSingleIndexerBackgroundTaskExecutor.reindex(ReindexSingleIndexerBackgroundTaskExecutor.java:103)
      	at com.liferay.portal.search.internal.background.task.ReindexBackgroundTaskExecutor.execute(ReindexBackgroundTaskExecutor.java:54)
      	at com.liferay.portal.background.task.internal.SerialBackgroundTaskExecutor.execute(SerialBackgroundTaskExecutor.java:62)
      	at com.liferay.portal.kernel.backgroundtask.DelegatingBackgroundTaskExecutor.execute(DelegatingBackgroundTaskExecutor.java:41)
      	at com.liferay.portal.background.task.internal.ThreadLocalAwareBackgroundTaskExecutor.execute(ThreadLocalAwareBackgroundTaskExecutor.java:72)
      	at com.liferay.portal.background.task.internal.messaging.BackgroundTaskMessageListener.doReceive(BackgroundTaskMessageListener.java:131)
      	at com.liferay.portal.kernel.messaging.BaseMessageListener.receive(BaseMessageListener.java:26)
      	at com.liferay.portal.kernel.messaging.InvokerMessageListener.receive(InvokerMessageListener.java:74)
      	at com.liferay.portal.messaging.internal.ParallelDestination$1.run(ParallelDestination.java:56)
      	at com.liferay.portal.kernel.concurrent.ThreadPoolExecutor$WorkerTask._runTask(ThreadPoolExecutor.java:752)
      	at com.liferay.portal.kernel.concurrent.ThreadPoolExecutor$WorkerTask.run(ThreadPoolExecutor.java:664)
      	at java.base/java.lang.Thread.run(Thread.java:834)

      Expected Result:  Update the commons-codec to the version that is appropriate to the Apache Tika JAR that is in use.

      Attachments

        Activity

          People

            yvonne.han Yvonne Han
            hau.bui Hau Bui
            Kiyoshi Lee Kiyoshi Lee
            To To Trinh To To Trinh
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              2 years, 2 weeks, 5 days ago

              Packages

                Version Package
                7.0.0 DXP FP97
                7.0.X
                7.1.10 DXP FP21
                7.1.X
                7.2.X
                7.3.5 CE GA6
                7.3.10 DXP GA1
                7.3.6 CE GA7
                7.3.X
                7.4.13 DXP GA1
                Master