Legacy Knowledge Base
Published Sep. 10, 2025

Taglib throws an exception after redeploy the JAR file

Written By

Anushka Tiwari

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

  • The taglib throws the freemarker.template.TemplateModelException error after redeploying the JAR file.
  • Steps to reproduce:
    1. Start the server
    2. Navigate to Site Menu> Content & Data > Blogs
    3. Create a new Blog, navigate to Site Menu > Design > Templates > Widget Templates
    4. Click plus icon and select 'Asset Publisher' (with name Taglib test) and add the following code:

    <#if entries?has_content>
    <#list entries as curEntry>
    <#assign assetRenderer=curEntry.getAssetRenderer() 
    viewURL=assetPublisherHelper.getAssetViewURL(renderRequest, renderResponse, assetRenderer, curEntry,
    !stringUtil.equals(assetLinkBehavior, "showFullContent" ))
    curBlogEntry=assetRenderer.getAssetObject() /> <h1>${curEntry.title}</h1>
    <@liferay_ratings["ratings"]
    className="com.liferay.blogs.model.BlogsEntry"
    classPK=curBlogEntry.getEntryId()
    /> </#list>
    </#if>


    5. Navigate to Site Builder > Pages
    6. Create a blank page. Now, Navigate to created page and drop 'Asset Publisher portlet'.
    7. Go to Asset Publisher configuration (hover on it and in the upper right corner)
    8. Under the set-up tab choose the 'Asset Selection' Tab.
    9. Select 'Dynamic' as the Asset Selection
    10. Select 'Blogs Entry' as Asset Type and click on 'Save'
    11. Under the setup tab choose 'Display Settings'
    12. Select Display Template 'Taglib test' and click on 'Save'
    13. Blog title will be displayed along with the information from Taglib
    14. Add one empty line or System.out.ptintln() in com.liferay.ratings.taglib.servlet.taglib.RatingsTag class and deploy ratings-taglib module from master.
    15. After deploying successfully. Return to the Page where the Asset Publisher is and there is a FreeMarker error message.

    Expected Behavior: Taglib should work fine.
    Observed Behavior: Taglib throws a FreeMarker error.

Environment

  • Liferay DXP 7.4

Resolution

  • The observed behavior is a known bug addressed by the LPS-183229 which is already included in Liferay DXP 7.4 update 79.

Additional Information

Did this article resolve your issue ?

Legacy Knowledge Base