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

NPE when rendering JournalArticleTag directly from a given theme

    Details

    • Branch Version/s:
      7.1.x, 7.0.x
    • Backported to Branch:
      Committed
    • Fix Priority:
      3

      Description

      Steps to reproduce:

      1. Create a Web Content
      2. Get groupId, articleId, and templateKey for that Web Content
      3. Create a theme
      4. Add <@liferay_journal["journal-article"] articleId="${articleId}" groupId=${groupId} templateKey="${templateKey}"/> to the portal_normal.ftl of the theme created previously replacing the variables with the real values obtained in step 2
      5. Build and deploy the theme
      6. Apply the theme
      7. Visit a page

      Expected result:

      • The Web Content is visible

      Actual result:

      • The Web Content is not visible
      • An error message is shown:
        2020-04-16 08:14:42.326 ERROR [http-nio-7080-exec-7][runtime:60] Error executing FreeMarker template
        FreeMarker template error:
        Error while invoking the "journal-article" JSP custom tag; see cause exception
        
        ----
        FTL stack trace ("~" means nesting-related):
        	- Failed at: @liferay_journal["journal-article"] a...  [in template "test-theme_SERVLET_CONTEXT_/templates/portal_normal.ftl" at line 51, column 1]
        ----
        
        Java stack trace (for programmers):
        ----
        freemarker.core._TemplateModelException: [... Exception message was already printed; see it above ...]
        	at freemarker.ext.jsp.JspTagModelBase.toTemplateModelExceptionOrRethrow(JspTagModelBase.java:154)
        	at freemarker.ext.jsp.TagTransformModel$TagWriter.onStart(TagTransformModel.java:367)
        	at freemarker.core.Environment.visitAndTransform(Environment.java:422)
        	at freemarker.core.UnifiedCall.accept(UnifiedCall.java:107)
        	at freemarker.core.Environment.visit(Environment.java:324)
        	at freemarker.core.MixedContent.accept(MixedContent.java:54)
        	at freemarker.core.Environment.visit(Environment.java:324)
        	at freemarker.core.Environment.process(Environment.java:302)
        	at freemarker.template.Template.process(Template.java:325)
        	at com.liferay.portal.template.freemarker.internal.FreeMarkerTemplate.processTemplate(FreeMarkerTemplate.java:139)
        	at com.liferay.portal.template.AbstractSingleResourceTemplate.processTemplate(AbstractSingleResourceTemplate.java:96)
        	at com.liferay.taglib.util.ThemeUtil.doIncludeFTL(ThemeUtil.java:285)
        	at com.liferay.taglib.util.ThemeUtil.doDispatch(ThemeUtil.java:158)
        	at com.liferay.taglib.util.ThemeUtil.includeFTL(ThemeUtil.java:101)
        	at com.liferay.taglib.util.ThemeUtil.include(ThemeUtil.java:83)
        	at com.liferay.taglib.theme.IncludeTag.doEndTag(IncludeTag.java:34)
        	at org.apache.jsp.html.common.themes.portal_jsp._jspx_meth_liferay_002dtheme_005finclude_005f1(portal_jsp.java:771)
        	at org.apache.jsp.html.common.themes.portal_jsp._jspService(portal_jsp.java:708)
        	at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
        	at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
        	at com.liferay.portal.servlet.DirectRequestDispatcher.forward(DirectRequestDispatcher.java:49)
        	at com.liferay.portal.servlet.ClassLoaderRequestDispatcherWrapper.doDispatch(ClassLoaderRequestDispatcherWrapper.java:81)
        	at com.liferay.portal.servlet.ClassLoaderRequestDispatcherWrapper.forward(ClassLoaderRequestDispatcherWrapper.java:45)
        	at com.liferay.portal.struts.StrutsUtil.forward(StrutsUtil.java:73)
        	at com.liferay.portal.struts.PortalRequestProcessor.doForward(PortalRequestProcessor.java:277)
        	at org.apache.struts.tiles.TilesRequestProcessor.processTilesDefinition(TilesRequestProcessor.java:271)
        	at org.apache.struts.tiles.TilesRequestProcessor.processForwardConfig(TilesRequestProcessor.java:332)
        	at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:232)
        	at com.liferay.portal.struts.PortalRequestProcessor.process(PortalRequestProcessor.java:170)
        	at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
        	at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:449)
        	at javax.servlet.http.HttpServlet.service(HttpServlet.java:622)
        	at com.liferay.portal.servlet.MainServlet.callParentService(MainServlet.java:607)
        	at com.liferay.portal.servlet.MainServlet.service(MainServlet.java:584)
        	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.BaseFilter.processFilter(BaseFilter.java:144)
        	at com.liferay.portal.servlet.filters.uploadservletrequest.UploadServletRequestFilter.processFilter(UploadServletRequestFilter.java:93)
        	at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:49)
        	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.servlet.filters.password.modified.PasswordModifiedFilter.processFilter(PasswordModifiedFilter.java:57)
        	at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:49)
        	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:144)
        	at com.liferay.portal.servlet.filters.secure.BaseAuthFilter.processFilter(BaseAuthFilter.java:340)
        	at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:49)
        	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:144)
        	at com.liferay.portal.servlet.filters.jsoncontenttype.JSONContentTypeFilter.processFilter(JSONContentTypeFilter.java:42)
        	at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:49)
        	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:144)
        	at com.liferay.portal.monitoring.internal.servlet.filter.MonitoringFilter.processFilter(MonitoringFilter.java:181)
        	at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:49)
        	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.InvokerFilter.doFilter(InvokerFilter.java:101)
        	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.processRequest(ApplicationDispatcher.java:466)
        	at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:391)
        	at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:318)
        	at com.liferay.portal.servlet.FriendlyURLServlet.service(FriendlyURLServlet.java:158)
        	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.BaseFilter.processFilter(BaseFilter.java:144)
        	at com.liferay.frontend.compatibility.ie.servlet.filter.IEMimeTypeCompatibilityFilter.processFilter(IEMimeTypeCompatibilityFilter.java:48)
        	at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:49)
        	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:144)
        	at com.liferay.portal.servlet.filters.uploadservletrequest.UploadServletRequestFilter.processFilter(UploadServletRequestFilter.java:93)
        	at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:49)
        	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:144)
        	at com.liferay.portal.servlet.filters.i18n.I18nFilter.processFilter(I18nFilter.java:361)
        	at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:49)
        	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.servlet.filters.password.modified.PasswordModifiedFilter.processFilter(PasswordModifiedFilter.java:57)
        	at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:49)
        	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:144)
        	at com.liferay.portal.servlet.filters.secure.BaseAuthFilter.processFilter(BaseAuthFilter.java:340)
        	at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:49)
        	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:144)
        	at com.liferay.portal.servlet.filters.jsoncontenttype.JSONContentTypeFilter.processFilter(JSONContentTypeFilter.java:42)
        	at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:49)
        	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:144)
        	at com.liferay.portal.servlet.filters.autologin.AutoLoginFilter.processFilter(AutoLoginFilter.java:259)
        	at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:49)
        	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:144)
        	at com.liferay.portal.servlet.filters.virtualhost.VirtualHostFilter.processFilter(VirtualHostFilter.java:263)
        	at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:49)
        	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:144)
        	at com.liferay.portal.monitoring.internal.servlet.filter.MonitoringFilter.processFilter(MonitoringFilter.java:181)
        	at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:49)
        	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 org.tuckey.web.filters.urlrewrite.RuleChain.handleRewrite(RuleChain.java:176)
        	at org.tuckey.web.filters.urlrewrite.RuleChain.doRules(RuleChain.java:145)
        	at org.tuckey.web.filters.urlrewrite.UrlRewriter.processRequest(UrlRewriter.java:92)
        	at org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:394)
        	at com.liferay.portal.servlet.filters.urlrewrite.UrlRewriteFilter.processFilter(UrlRewriteFilter.java:65)
        	at com.liferay.portal.kernel.servlet.BaseFilter.doFilter(BaseFilter.java:49)
        	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: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:101)
        	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:1149)
        	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
        	at java.lang.Thread.run(Thread.java:748)
        Caused by: java.lang.NullPointerException
        	at com.liferay.portal.kernel.portlet.PortletRequestModel.<init>(PortletRequestModel.java:62)
        	at com.liferay.journal.taglib.servlet.taglib.JournalArticleTag.doStartTag(JournalArticleTag.java:56)
        	at freemarker.ext.jsp.TagTransformModel$TagWriter.onStart(TagTransformModel.java:335)
        	... 159 more
        

      * Please see Zendesk Support tab for further comments and attachments.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              yang.cao Yang Cao
              Reporter:
              daniel.couso Daniel Couso
              Participants of an Issue:
              Recent user:
              Yunlin "Steven" Sun
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Days since last comment:
                1 year, 6 days ago

                  Packages

                  Version Package
                  7.0.0 DXP FP93
                  7.0.10.14 DXP SP14
                  7.0.X
                  7.1.10 DXP FP18
                  7.1.10.5 SP5
                  7.1.X