legacy-knowledge-base
公開されました Sep. 10, 2025

Warning in logs: "No theme found for specified theme id" after uninstalling a theme

written-by

Daniel Martinez Cisneros

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

Issue

  • After migrating, the following warning appears in the logs:
    2025-05-19 08:51:53,593 WARN  [ajp-nio-10.10.13.111-8009-exec-83][ThemeLocalServiceImpl:220] No theme found for specified theme id yourOld_WAR_theme. Returning the default theme.
  • The theme yourOld_WAR_theme was uninstalled but the personal sites still have it associated.

Environment

  • Liferay DXP 2024.Q3

Resolution

  • Use a Groovy script to update the theme for the affected personal sites. When a theme is uninstalled, the theme for the pages or page sets using it is not automatically updated and must be modified manually or with a Groovy script.
    import com.liferay.portal.kernel.service.LayoutLocalServiceUtil
    import com.liferay.portal.kernel.service.LayoutSetLocalServiceUtil
    
    // Define the theme IDs
    def oldThemeId = "yourOld_WAR_theme"
    def newThemeId = "yourNew_WAR_theme"
    
    def dryRun = true
    
    def layouts = LayoutLocalServiceUtil.getLayouts(-1, -1)
    
    layouts.each { layout -
        def themeId = layout.getThemeId()
    
        if (themeId == oldThemeId) {
            println "Found layout using oldThemeId - Layout ID: ${layout.getPlid()}; friendlyURL: ${layout.getFriendlyURL()}; Theme ID: ${themeId}"
    
            if (!dryRun) {
                // Switch to the new theme
                layout.setThemeId(newThemeId)
    
                // Update the layout to save changes
                LayoutLocalServiceUtil.updateLayout(layout)
            }
       }
    }
    
    def layoutSets = LayoutSetLocalServiceUtil.getLayoutSets(-1, -1)
    
    layoutSets.each { layoutSet -
        def themeId = layoutSet.getThemeId()
    
        if (themeId == oldThemeId) {
            println "Found layoutSet using oldThemeId - LayoutSet ID: ${layoutSet.getLayoutSetId()}; Theme ID: ${themeId}"
    
            if (!dryRun) {
                layoutSet.setThemeId(newThemeId)
    
                LayoutSetLocalServiceUtil.updateLayoutSet(layoutSet)
            }
        }
    }

 

 

did-this-article-resolve-your-issue

legacy-knowledge-base