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

Error during file indexing: ClassNotFoundException: org.bouncycastle.asn1.ASN1Encodable

written-by

Jose L. Bango

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

Issue

  • When indexing files, the process fails (terminates abruptly) and the following information is printed in the logs: org.bouncycastle.asn1.ASN1Encodable cannot be found by com.liferay.shared.dependencies.pdfbox_1.0.2:
    WARN [liferay/background_task-5][IndexerWriterImpl:188] Error reindexing all com.liferay.document.library.kernel.model.DLFileEntry for company: 99999
    com.liferay.portal.kernel.exception.SystemException: java.lang.NoClassDefFoundError: org/bouncycastle/asn1/ASN1Encodable
    ...
    Caused by: java.lang.NoClassDefFoundError: org/bouncycastle/asn1/ASN1Encodable
    ...
    Caused by: java.lang.ClassNotFoundException: org.bouncycastle.asn1.ASN1Encodable cannot be found by com.liferay.shared.dependencies.pdfbox_1.0.2
    ...

Environment

  • Liferay DXP 2023.Q4.0

Resolution

  • First, try to locate the conflicting file. For example, you can enable logging for com.liferay.document.library.internal.search.spi.model.index.contributor.DLFileEntryModelDocumentContributor, which will print messages each time a file is indexed.
  • Ideally, the file should be shared with the support team through a ticket so the issue can be reproduced easily.
  • If for security reasons this is not possible, try to find an alternative test file that produces the same error.
  • Be aware that, otherwise, the support team will be limited in their ability to resolve the case.

Workaround

  • You can add the file extension to dl.file.indexing.ignore.extensions property to prevent it from being indexed.
  • If it's a common extension like .pdf, you can change its extension (e.g., my-file.pdf.noindex), add the .noindex extension to the mentioned property and upload the file again with its new extension.

Additional Information

did-this-article-resolve-your-issue

legacy-knowledge-base