Legacy Knowledge Base
Published Jul. 2, 2025

Freemarker error: "Denied access to model object as it does not belong to current company"

Written By

Kanchan Bisht

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

  • Some freemarker templates show the message: "Denied access to model object as it does not belong to current company 20116"
  • Reproduction Steps
    1) Setup Liferay DXP 7.3 with Fix Pack 1
    2) Navigate to Control Panel→System Settings→Template Engines
    3) Look for serviceLocator→click on the minus button to remove it→Update
    4) Return to the site
    5) Create a structure with DocumentList.jsonas source and TestStructure as the title
    6) Create a template with DocumentList_mod.ftl
    7) Navigate to Documents and Media→ Document Types→ + sign
    8) Title: TestDocumentType
    9) Add a Documents & Media field→ Save
    10)Add a new TestDocumentType→ title: TestDDM
    11)Click on Select→upload an image (jpg)→ Save
    12)Create web content with TestStructure
    13)Set TestDDM for the Documents field→ Publish
    14)Create a widget page TestWidgetPage
    15)Click on the + sign to add portlets
    16)Click on the Content tab
    17)Search for TestWebContent and place it onto the page
    18)Checkpoint: a link is visible: Documents
    19)Open TestWebContent again
    20)Change the Documents field to uploaded image(jpg)→Publish
    21)Visit TestWidgetPage again
    Expected Behavior: The user can see the link to the image, just like in the checkpoint step.
    Observed Behavior: Error in server logs and in the web content display 
  • An error occurred while processing the template. Denied access to model object as it does not belong to current company 20097 ---- FTL stack trace ("~" means nesting-related): - Failed at: #local fileEntryType = fileEntry.getD... [in template "20097#20123#40609" in macro "renderDocumentListContent" at line 33, column 17] - Reached through: @renderDocumentListContent text, docu... [in template "20097#20123#40609" at line 106, column 9] ----

Environment

  • Liferay DXP 7.3 with fix pack 1

Resolution

  • The observed behavior is a known issue and is fixed by LPS-135290
  • If the hotfix is required for this issue, please create a support ticket requesting the hotfix by attaching the patch details.
  • Installing Fix Packs and Hotfixes on Liferay DXP will guide you to install the Fixpack/Hotfix in your environment.

Additional Information

  • Try the above activity in a lower environment first, if all works well, then move to the production environment as per your discretion.
  • Perform these operations in application server downtime, because these steps require the restart of the server.
Did this article resolve your issue ?

Legacy Knowledge Base