Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-72579

ThemeId not found by Resources Importer if not found in sitemap.json

    Details

    • Type: Bug
    • Status: Closed
    • Resolution: Won't Fix
    • Affects Version/s: 6.2.X EE, 7.0.0 DXP SP3, 7.0.0 DXP FP15, 7.0.X EE
    • Fix Version/s: None
    • Labels:
    • Fix Priority:
      3

      Description

      Description

      When deploying a theme.war that uses resources importer, FileSystemImporter attempts to update the Layoutset using updateLayoutSetThemeId(JSONObject sitemapJSONObject) and searching for "themeId" (here). However, a themeId is not getting prepended into the sitemap.json by any code so updateLookAndFeel is not called for the Layout. 
      Perhaps the reason why themes have been deploying correctly thus far is based off an unmentioned convention that themeId's should be a concatenation of three fields: themeId specified in the liferay-look-and-feel.xml + WAR + servletContextName (which is the name of the war). This "guess" is carried out in the next few lines of code. So if liferay-look-and-feel.xml specifies your themeId as "space program" and you name your war, "space-program-theme.war" those next few lines of code will correctly guess the themeId should be spaceprogram_WAR_spaceprogramtheme, and updates the look and feel of the theme. Otherwise, if the user names their .war anything else, the guess will not work and updateLookAndFeel will not get called.

      Steps to reproduce bug in code

      1. Start up Liferay with debugging enabled and set a breakpoint here.
      2. Deploy the attached theme.
      3. Step through the code. 

      Results

      Expected: themeId is found in the sitemap.json
      Actual: themeId is not found (null) and the code attempts to guess the appropriate themeId based on the servletContextName (war name) but fails as well

      Steps to reproduce error

      1. Start up an instance of Liferay
      2. Place theme in the deploy folder
      3. Go to Navigate --> Public Pages --> Configure --> Change Current theme and apply theme to public pages
      4. Navigate to the main Liferay page to view the theme.

      Results

      Expected: Theme shows with no errors
      Actual: Errors displayed to console

      Errors

      15-May-2017 19:59:14.782 SEVERE [http-nio-8080-exec-13] org.apache.catalina.core.ApplicationDispatcher.invoke Servlet.service() for servlet default threw exception
       java.io.FileNotFoundException: The requested resource (/space-program-theme/js/top_search.es.js) is not available
      	at org.apache.catalina.servlets.DefaultServlet.serveResource(DefaultServlet.java:722)
      	at org.apache.catalina.servlets.DefaultServlet.doGet(DefaultServlet.java:398)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:622)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
      	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:292)
      	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
      	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:119)
      	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilter.doFilter(InvokerFilter.java:99)
      	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
      	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
      	at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:720)
      	at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:584)
      	at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:523)
      	at com.liferay.portal.kernel.servlet.RequestDispatcherUtil.getContentAndLastModifiedTime(RequestDispatcherUtil.java:41)
      	at com.liferay.portal.servlet.ComboServlet.getResourceContent(ComboServlet.java:313)
      	at com.liferay.portal.servlet.ComboServlet.doService(ComboServlet.java:233)
      	at com.liferay.portal.servlet.ComboServlet.service(ComboServlet.java:86)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
      	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:292)
      	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
      	at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
      	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
      	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
      	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:119)
      	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDirectCallFilter(InvokerFilterChain.java:168)
      	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:96)
      	at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:142)
      	at com.liferay.portal.servlet.filters.language.LanguageFilter.processFilter(LanguageFilter.java:82)
      	at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:48)
      	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:207)
      	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:112)
      	at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:142)
      	at com.liferay.portal.servlet.filters.gzip.GZipFilter.processFilter(GZipFilter.java:125)
      	at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:48)
      	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:207)
      	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:112)
      	at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:142)
      	at com.liferay.portal.servlet.filters.cache.CacheFilter.processFilter(CacheFilter.java:428)
      	at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:48)
      	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:207)
      	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:112)
      	at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:142)
      	at com.liferay.portal.servlet.filters.etag.ETagFilter.processFilter(ETagFilter.java:86)
      	at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:48)
      	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:207)
      	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:112)
      	at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:142)
      	at com.liferay.portal.servlet.filters.header.HeaderFilter.processFilter(HeaderFilter.java:96)
      	at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:48)
      	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:207)
      	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:112)
      	at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:142)
      	at com.liferay.portal.sharepoint.SharepointFilter.processFilter(SharepointFilter.java:88)
      	at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:48)
      	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:207)
      	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:112)
      	at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:142)
      	at com.liferay.portal.servlet.filters.virtualhost.VirtualHostFilter.processFilter(VirtualHostFilter.java:265)
      	at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:48)
      	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:207)
      	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:112)
      	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDirectCallFilter(InvokerFilterChain.java:188)
      	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:96)
      	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDirectCallFilter(InvokerFilterChain.java:188)
      	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:96)
      	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDirectCallFilter(InvokerFilterChain.java:168)
      	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:96)
      	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDirectCallFilter(InvokerFilterChain.java:168)
      	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:96)
      	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDirectCallFilter(InvokerFilterChain.java:188)
      	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:96)
      	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilter.doFilter(InvokerFilter.java:99)
      	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
      	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
      	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:212)
      	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106)
      	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
      	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:141)
      	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
      	at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:616)
      	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)
      	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:522)
      	at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1095)
      	at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:672)
      	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1500)
      	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1456)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
      	at java.lang.Thread.run(Thread.java:748)
      
      19:59:14,785 ERROR [http-nio-8080-exec-13][ComboServlet:89] java.io.FileNotFoundException: The requested resource (/space-program-theme/js/top_search.es.js) is not available
      java.io.FileNotFoundException: The requested resource (/space-program-theme/js/top_search.es.js) is not available
      	at org.apache.catalina.servlets.DefaultServlet.serveResource(DefaultServlet.java:722)
      	at org.apache.catalina.servlets.DefaultServlet.doGet(DefaultServlet.java:398)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:622)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
      	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:292)
      	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
      	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:119)
      	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilter.doFilter(InvokerFilter.java:99)
      	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
      	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
      	at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:720)
      	at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:584)
      	at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:523)
      	at com.liferay.portal.kernel.servlet.RequestDispatcherUtil.getContentAndLastModifiedTime(RequestDispatcherUtil.java:41)
      	at com.liferay.portal.servlet.ComboServlet.getResourceContent(ComboServlet.java:313)
      	at com.liferay.portal.servlet.ComboServlet.doService(ComboServlet.java:233)
      	at com.liferay.portal.servlet.ComboServlet.service(ComboServlet.java:86)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
      	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:292)
      	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
      	at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
      	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
      	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
      	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:119)
      	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDirectCallFilter(InvokerFilterChain.java:168)
      	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:96)
      	at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:142)
      	at com.liferay.portal.servlet.filters.language.LanguageFilter.processFilter(LanguageFilter.java:82)
      	at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:48)
      	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:207)
      	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:112)
      	at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:142)
      	at com.liferay.portal.servlet.filters.gzip.GZipFilter.processFilter(GZipFilter.java:125)
      	at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:48)
      	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:207)
      	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:112)
      	at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:142)
      	at com.liferay.portal.servlet.filters.cache.CacheFilter.processFilter(CacheFilter.java:428)
      	at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:48)
      	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:207)
      	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:112)
      	at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:142)
      	at com.liferay.portal.servlet.filters.etag.ETagFilter.processFilter(ETagFilter.java:86)
      	at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:48)
      	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:207)
      	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:112)
      	at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:142)
      	at com.liferay.portal.servlet.filters.header.HeaderFilter.processFilter(HeaderFilter.java:96)
      	at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:48)
      	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:207)
      	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:112)
      	at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:142)
      	at com.liferay.portal.sharepoint.SharepointFilter.processFilter(SharepointFilter.java:88)
      	at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:48)
      	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:207)
      	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:112)
      	at com.liferay.portal.kernel.servlet.BaseFilter.processFilter(BaseFilter.java:142)
      	at com.liferay.portal.servlet.filters.virtualhost.VirtualHostFilter.processFilter(VirtualHostFilter.java:265)
      	at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:48)
      	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDoFilter(InvokerFilterChain.java:207)
      	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:112)
      	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDirectCallFilter(InvokerFilterChain.java:188)
      	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:96)
      	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDirectCallFilter(InvokerFilterChain.java:188)
      	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:96)
      	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDirectCallFilter(InvokerFilterChain.java:168)
      	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:96)
      	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDirectCallFilter(InvokerFilterChain.java:168)
      	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:96)
      	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.processDirectCallFilter(InvokerFilterChain.java:188)
      	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:96)
      	at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilter.doFilter(InvokerFilter.java:99)
      	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
      	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
      	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:212)
      	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106)
      	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
      	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:141)
      	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
      	at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:616)
      	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)
      	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:522)
      	at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1095)
      	at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:672)
      	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1500)
      	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1456)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
      	at java.lang.Thread.run(Thread.java:748)
      19:59:15,155 ERROR [http-nio-8080-exec-13][status_jsp:901] The requested resource (/space-program-theme/js/top_search.es.js) is not available
      

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Days since last comment:
                  23 weeks, 4 days ago