Legacy Knowledge Base
公開されました Sep. 10, 2025

DLAppService.AddFileEntry 関数で NoSuchMethodError を受信している。

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.

問題

  • 以下の方法で、ポータルに のファイルエントリーを追加します。配置時。
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)
  • ポータル起動時に以下のエラーが発生します:
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

解決策

追加情報

  • DXP 7.2 にも、以前は addFileEntry メソッドがありましたが、これは 非推奨となっています:
addFileEntry(    long repositoryId, long folderId, String sourceFileName,
String mimeType, String title, String description,
String changeLog, byte[] bytes,
com.liferay.portal.kernel.service.ServiceContext serviceContext)
  • com.liferay.portal.kernel, 正しい機能を使用できない可能性があるので、正しいバージョンのパッケージをインポートするように注意してください。
Did this article resolve your issue ?

Legacy Knowledge Base