legacy-knowledge-base
公開されました Jun. 30, 2025

「NoSuchFileEntryException」のエラーメッセージが表示される

written-by

Shimada Taro

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

問題

  • 以下のようなエラーがスローされます。
ERROR [liferay/scheduler_dispatch-3][TrashEntryLocalServiceImpl:190] com.liferay.document.library.kernel.exception.NoSuchFileEntryException: No FileEntry exists with the key {fileEntryId=XXXX}

環境

  • DXP 7.0+

解決

  • TrashEntryテーブルに、元のテーブルから削除された要素への参照が存在するようです。
    fileEntryId のIDを持つ FileEntry が影響しています。
  • 以下のクエリを実行し、ドキュメントライブラリのエントリを確認します。
    select * from DLFileEntry where fileEntryId = 67110;
     
    以下のクエリを実行し、ゴミ箱のエントリを確認します。
    select * from TrashEntry where classPK = 67110;

    ゴミ箱のコンテンツを削除する場合、元の要素も同時に削除されます。
    元のレコードが存在しないため、NoSuchFileEntryException がスローされます。
     
    以下のスクリプトを実行することで、TrashEntryテーブルから不要なテーブルを削除します。
    テーブルが削除されることで、エラーが発生しなくなる認識です。
    import com.liferay.trash.service.TrashEntryLocalServiceUtil

    def entry = TrashEntryLocalServiceUtil.getTrashEntry(XXXX);

    TrashEntryLocalServiceUtil.deleteEntry(entry);
did-this-article-resolve-your-issue

legacy-knowledge-base