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

Freemarker layout template that uses processPortlet method on TemplateProcessor prints errors on deployment

Details

    Description

      Steps to Reproduce

      1. Prepare a Liferay Tomcat bundle
      2. Add the following to any layout template (.ftl) file in webapps/ROOT/layouttpl/custom
        ${processor.processPortlet("com_liferay_hello_world_web_portlet_HelloWorldPortlet")}
      3. Start up Liferay

      Expected behavior is that Liferay starts without errors. Actual behavior is that Liferay will error out on deploying the modified template, with an exception similar to the following:

      The following has evaluated to null or missing:
      ==> processor.processPortlet  [in template "..." at line X, column Y]
      
      Java stack trace (for programmers):
      ----
      freemarker.core.InvalidReferenceException: [... Exception message was already printed; see it above ...]
      	at freemarker.core.InvalidReferenceException.getInstance(InvalidReferenceException.java:131)
      	at freemarker.core.UnexpectedTypeException.newDesciptionBuilder(UnexpectedTypeException.java:77)
      	at freemarker.core.UnexpectedTypeException.<init>(UnexpectedTypeException.java:40)
      	at freemarker.core.NonMethodException.<init>(NonMethodException.java:46)
      	at freemarker.core.MethodCall._eval(MethodCall.java:84)
      	at freemarker.core.Expression.eval(Expression.java:78)
      	at freemarker.core.Expression.evalAndCoerceToString(Expression.java:82)
      	at freemarker.core.DollarVariable.accept(DollarVariable.java:41)
      	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:123)
      	at com.liferay.portal.template.AbstractSingleResourceTemplate.processTemplate(AbstractSingleResourceTemplate.java:78)
      	at com.liferay.portal.service.impl.LayoutTemplateLocalServiceImpl._getColumns(LayoutTemplateLocalServiceImpl.java:515)
      

      Attachments

        Issue Links

          Activity

            People

              sharry.shi Sharry Shi
              minhchau.dang Minhchau Dang
              Marta Elicegui Marta Elicegui
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                4 years, 10 weeks ago

                Packages

                  Version Package
                  7.0.0 DXP FP60
                  7.0.0 DXP SP9
                  7.0.X
                  7.1.10 DXP FP3
                  7.1.1 CE GA2
                  7.1.10.1 SP1
                  7.1.X
                  Master