Legacy Knowledge Base
Published Jul. 2, 2025

Export of site fails with 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

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

  • We want to export our site into a LAR file, but it fails with the below error on the 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.
  • The below exception is shown in the server logs:
    • 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)

Environment

  • Liferay DXP 7.0+

Resolution

  • The attached exception usually appears when the template related to the web content is not found, in this case, it's the default Basic Web Content template from the Global site

  • Normally on the UI, you can't delete a structure or template that has at least one web content associated to it, an error message will say: Error:The template cannot be deleted because it is required by one or more template links.
  • However, it can happen by an accidental API call or deleting it directly from the database (Direct database modifications are not supported)
  • Verify the issue by checking your database's ddmtemplate table and see if there is a record with the 'BASIC-WEB-CONTENT' templateKey

  • If not, then you will need to restore it with a workaround to override the reference checking:
    1. Please download the appropriate version of DXP bundle by going to the Liferay Help Center Homepage, select the DXP product -> Downloads tab -> Latest Release
    2. Start the bundle
    3. Export the Global site's web content portlet
    4. Then import it in your environment's Global site's web content section.
    5. After that, you will be able to export your site

Additional Information

  • The restored template has a different unique key and it isn't associated with Article1, therefore you will be able to delete it from the UI without any error messages.
  • If you create new basic web contents, the template will be protected again against deleting it from the UI

 

Did this article resolve your issue ?

Legacy Knowledge Base