legacy-knowledge-base
公開されました Jul. 2, 2025

サイトのエクスポートがNoSuchTemplateExceptionで失敗する

written-by

István Gergely-Tárnoki

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

課題

  • サイトをLARファイルにエクスポートしたいのですが、UIで以下のエラーが出て失敗します。
    • An unexpected error occurred with the publication process. Please check your portal and publishing configuration.
      The Web Content Article: Article1 has missing reference(s) that could not be found during the process.
  • サーバーログに以下のような例外が表示されます。
    • Caused by: com.liferay.dynamic.data.mapping.exception.NoSuchTemplateException: No DDMTemplate exists with the template key BASIC-WEB-CONTENT in the ancestor groups at
      com.liferay.dynamic.data.mapping.service.impl.DDMTemplateLocalServiceImpl.getTemplate(DDMTemplateLocalServiceImpl.java:670) at
      com.liferay.journal.internal.exportimport.data.handler.JournalArticleStagedModelDataHandler.doExportStagedModel(JournalArticleStagedModelDataHandler.java:405) at
      com.liferay.journal.internal.exportimport.data.handler.JournalArticleStagedModelDataHandler.doExportStagedModel(JournalArticleStagedModelDataHandler.java:106) at
      com.liferay.exportimport.kernel.lar.BaseStagedModelDataHandler.exportStagedModel(BaseStagedModelDataHandler.java:102)

環境

  • ライフレイDXP 7.0

解像度

  • 添付の例外は、通常、Webコンテンツに関連するテンプレートが見つからない場合に表示されます。この場合、グローバルサイトのデフォルトのBasic Web Contentテンプレートです。

  • 通常、UI上では、少なくとも1つのWebコンテンツが関連付けられている構造体やテンプレートを削除することはできず、エラーメッセージが表示されます。 エラー:テンプレートは、1つ以上のテンプレート リンクによって必要とされるため、削除できません。
  • しかし、誤ってAPIを呼び出したり、データベースから直接削除したりすることで起こる可能性があります(データベースの直接変更はサポートされていません)。
  • データベースの ddmtemplate テーブルをチェックし、「BASIC-WEB-CONTENT」 templateKey を持つレコードがあるかどうかで問題を確認します。

  • そうでない場合は、参照チェックを無効にするワークアラウンドで復元する必要があります。
    1. DXPバンドルの適切なバージョンをダウンロードするには、 Liferay Help Center Homepage、DXP製品を選択 -> Downloadsタブ -> Latest Releaseと進みます。
    2. バンドルの開始
    3. グローバルサイトのウェブコンテンツポートレットのエクスポート
    4. そして、あなたの環境のグローバルサイトのウェブコンテンツセクションにインポートします。
    5. その後、サイトをエクスポートすることができるようになります。

追加情報

  • 復元されたテンプレートには異なる一意のキーがあり、Article1に関連付けられていないため、エラーメッセージなしにUIから削除することができます。
  • 新しい基本的なWebコンテンツを作成すると、UIからテンプレートを削除しても再び保護されます

did-this-article-resolve-your-issue

legacy-knowledge-base