Legacy Knowledge Base
Published Sep. 10, 2025

Receiving NoSuchMethodError on DLAppService.AddFileEntry function

Written By

Solyom Nagy-Györkös

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

  • Using the following method, to add file entries to the portal, at deployment:
addFileEntry(   String externalReferenceCode, long repositoryId, long folderId,
                String sourceFileName, String mimeType, String title,
                String description, String changeLog, byte[] bytes,
                java.util.Date expirationDate, java.util.Date reviewDate,
              com.liferay.portal.kernel.service.ServiceContext serviceContext)
  • Receiving the following error during portal startup:
Caused by: java.lang.NoSuchMethodError: com.liferay.document.library.kernel.service.DLAppService.addFileEntry(Ljava/lang/String;JJLjava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;[BLjava/util/Date;Ljava/util/Date;Lcom/liferay/portal/kernel/service/ServiceContext;)Lcom/liferay/portal/kernel/repository/model/FileEntry;

Environment

  • DXP 7.4

Resolution

Additional Information

  • There is addFileEntry method previously in DXP 7.2 as well, which has been deprecated:
addFileEntry(    long repositoryId, long folderId, String sourceFileName,
String mimeType, String title, String description,
String changeLog, byte[] bytes,
com.liferay.portal.kernel.service.ServiceContext serviceContext)
  • Beware to import the right version of the package com.liferay.portal.kernel, as this can prevent you to use the correct function
Did this article resolve your issue ?

Legacy Knowledge Base