Legacy Knowledge Base
Published 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

You are viewing an article from our legacy "FastTrack" publication program, made available for informational purposes. Articles in this program were published without a requirement for independent editing or verification and are provided"as is" without guarantee.

Before using any information from this article, independently verify its suitability for your situation and project.

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