legacy-knowledge-base
公開されました Sep. 10, 2025

FileImpl "Unable to extract text from" および TIKA ライブラリに関連するドキュメントのインデックス作成中のその他のエラー

written-by

Jorge Diaz

How To articles are not official guidelines or officially supported documentation. They are community-contributed content and may not always reflect the latest updates to Liferay DXP. We welcome your feedback to improve How To articles!

While we make every effort to ensure this Knowledge Base is accurate, it may not always reflect the most recent updates or official guidelines.We appreciate your understanding and encourage you to reach out with any feedback or concerns.

legacy-article

learn-legacy-article-disclaimer-text

問題

ドキュメント (DLFileEntry) の再インデックスを実行すると、ログ ファイルにいくつかの警告とエラーが記録され、FileImpl と TikaException に関連する"Unable to extract text from"というメッセージが記録されます。

  • 長さ 1133957 の配列を割り当てようとしましたが、このレコード タイプの最大値は 1000000 です。
2021-03-08T18:03:06.882+0100 WARN  [default-37][FileImpl:468] Unable to extract text from file_name
org.apache.tika.exception.TikaException: Unexpected RuntimeException from org.apache.tika.parser.microsoft.OfficeParser@5d15b90a
     at org.apache.tika.parser.CompositeParser.parse(CompositeParser.java:293)
     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:1142)
     at com.liferay.portal.util.FileImpl.extractText(FileImpl.java:449)
     at com.liferay.portal.kernel.util.FileUtil.extractText(FileUtil.java:217)
[...]
     at com.liferay.portal.search.internal.SearchEngineInitializer.reindex(SearchEngineInitializer.java:190)
     at com.liferay.portal.search.internal.SearchEngineInitializer$1.call(SearchEngineInitializer.java:146)
     at com.liferay.portal.search.internal.SearchEngineInitializer$1.call(SearchEngineInitializer.java:139)
     at java.util.concurrent.FutureTask.run(FutureTask.java:266)
     at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
     at java.util.concurrent.FutureTask.run(FutureTask.java:266)
     at co.elastic.apm.agent.impl.async.SpanInScopeRunnableWrapper.run(SpanInScopeRunnableWrapper.java:64)
     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: org.apache.poi.util.RecordFormatException: Tried to allocate an array of length 1133957, but 1000000 is the maximum for this record type._If the file is not corrupt, please open an issue on bugzilla to request _increasing the maximum allowable size for this record type._As a temporary workaround, consider setting a higher override value with IOUtils.setByteArrayMaxOverride()

または

2021-03-30T21:43:11.878+0200 WARN  [default-6][FileImpl:478] Unable to extract text from file_name.docx
org.apache.tika.exception.TikaException: Unexpected RuntimeException from org.apache.tika.parser.microsoft.ooxml.OOXMLParser@2c5260e5
    at org.apache.tika.parser.CompositeParser.parse(CompositeParser.java:293)
    at org.apache.tika.parser.CompositeParser.parse(CompositeParser.java:280)
    at org.apache.tika.parser.AutoDetectParser.parse(AutoDetectParser.java:143)
    at com.liferay.portal.util.FileImpl._parseToString(FileImpl.java:1183)
    at com.liferay.portal.util.FileImpl.extractText(FileImpl.java:459)
    at com.liferay.portal.kernel.util.FileUtil.extractText(FileUtil.java:217)
[...]
    at com.liferay.portal.search.internal.SearchEngineInitializer.reindex(SearchEngineInitializer.java:190)
    at com.liferay.portal.search.internal.SearchEngineInitializer$1.call(SearchEngineInitializer.java:146)
    at com.liferay.portal.search.internal.SearchEngineInitializer$1.call(SearchEngineInitializer.java:139)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at co.elastic.apm.agent.impl.async.SpanInScopeRunnableWrapper.run(SpanInScopeRunnableWrapper.java:64)
    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: org.apache.poi.util.RecordFormatException: Tried to allocate an array of length 2077184, but 2000000 is the maximum for this record type._If the file is not corrupt, please open an issue on bugzilla to request _increasing the maximum allowable size for this record type._As a temporary workaround, consider setting a higher override value with IOUtils.setByteArrayMaxOverride() [Sanitized]
    at org.apache.poi.util.IOUtils.throwRFE(IOUtils.java:630)
    at org.apache.poi.util.IOUtils.checkLength(IOUtils.java:205)
    at org.apache.poi.util.IOUtils.toByteArray(IOUtils.java:173)
    at org.apache.poi.util.IOUtils.toByteArray(IOUtils.java:149)
    at org.apache.poi.openxml4j.util.ZipArchiveFakeEntry.(ZipArchiveFakeEntry.java:47)
    at org.apache.poi.openxml4j.util.ZipInputStreamZipEntrySource.(ZipInputStreamZipEntrySource.java:53)
    at org.apache.poi.openxml4j.opc.ZipPackage.(ZipPackage.java:106)
    at org.apache.poi.openxml4j.opc.OPCPackage.open(OPCPackage.java:307)
    at org.apache.tika.parser.microsoft.ooxml.OOXMLExtractorFactory.parse(OOXMLExtractorFactory.java:111)
    at org.apache.tika.parser.microsoft.ooxml.OOXMLParser.parse(OOXMLParser.java:113)
    at org.apache.tika.parser.CompositeParser.parse(CompositeParser.java:280)
    ... 41 more

どちらの場合も、ログ トレースには次のように記載されています。

    • As a temporary workaround, consider setting a higher override value with IOUtils.setByteArrayMaxOverride()

そのため、Tika ライブラリでその設定を変更する必要があります。

 

  • MatParser を使用した Matlab ファイルの解析エラー
2021-03-08T09:25:48.010+0100 WARN  [default-3][FileImpl:468] Unable to extract text from file_name.fig
org.apache.tika.exception.TikaException: Error parsing Matlab file with MatParser
    at org.apache.tika.parser.mat.MatParser.parse(MatParser.java:139)
    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 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: com.jmatio.io.MatlabIOException: Incorrect matlab array class: function_handle
    at com.jmatio.io.MatFileReader.readMatrix(MatFileReader.java:930)

 

  • Tika/MP4Parser でサポートされていないビデオ形式によるエラー:
2021-03-08T09:34:11.498+0100 ERROR [default-3][BasicContainer:122] Error during box parsing: java.lang.RuntimeException: box size of zero means 'till end of file. That is not yet supported
2021-03-08T09:34:11.499+0100 ERROR [default-3][BasicContainer:122] Error during box parsing: org.mp4parser.MemoryAllocationException: Tried to allocate 1937011819 bytes, but the limit for this record type is: 536870912. If you believe this file is not corrupt, please open a ticket on github to increase the maximum allowable size for this record type.
2021-03-08T09:34:11.499+0100 ERROR [default-3][BasicContainer:122] Error during box parsing: org.mp4parser.MemoryAllocationException: Tried to allocate 85899348400 bytes, but the limit for this record type is: 536870912. If you believe this file is not corrupt, please open a ticket on github to increase the maximum allowable size for this record type.
2021-03-08T09:34:11.499+0100 ERROR [default-3][BasicContainer:122] Error during box parsing: org.mp4parser.MemoryAllocationException: Tried to allocate 1668576363 bytes, but the limit for this record type is: 536870912. If you believe this file is not corrupt, please open a ticket on github to increase the maximum allowable size for this record type.

使用したくないパーサーを無効にするにはどうすればよいですか? (たとえば、Matlab MatParser または MP4Parser パーサーなど)

TIKA ライブラリに関連する警告またはエラー トレースを回避するにはどうすればよいですか?

環境

  • Liferay DXP 7.0
  • Liferay DXP 7.1
  • Liferay DXP 7.2
  • Liferay DXP 7.3

解決

TIKA ライブラリの構成を変更すると、エラーの一部を回避できます。たとえば、次のことができます。

TIKA ライブラリの構成は、 portal-impl.jar内の tika.xml ファイルで指定されています。この構成を独自の構成でオーバーライドするには、次の手順を実行する必要があります。

  1. tika.xmlファイルを jar ファイルから抽出します: [LIFERAY_HOME]/tomcat-[version]/webapps/WEB-INF/lib/portal-impl.jar
    • jar ファイルは、任意の解凍ツール (linux: unzip、windows: 7zip または winzip) で開くことができます。
    • jar ファイル内では、zip ファイルの tika ディレクトリ内に tika.xml ファイルがあります。 tika/tika.xml
  2. 抽出した tika.xml ファイルを、適用する必要のある変更で変更します。 さらに詳しい情報が必要な場合は、"Additional Information"セクションのリンクを参照してください。
  3. 変更した tika.xml ファイルをシステムのカスタム構成フォルダー内 (たとえば [LIFERAY_HOME]内) に保存します。
  4. system-ext.properties [LIFERAY_HOME]/tomcat-[version]/webapps/WEB-INF/classes フォルダー内に作成して、DXP クラスパスに追加します。 system-ext.properties ファイルの作成に関する詳細情報が必要な場合は、 System-ext.properties リファレンス ガイドを確認してください。
  5. 次の行を system-ext.propertiesに追加します。
    • tika.config=/absolute_path_to_the_configuration_file/tika.xml
    • absolute_path_to_the_configuration_file テキストを、tika.xml ファイルへの特定のフォルダー パスに置き換える必要があります。
  6. Liferay サーバーを再起動します

 

追加情報

did-this-article-resolve-your-issue

legacy-knowledge-base