legacy-knowledge-base
公開されました Jul. 2, 2025

Freemarker エラー: 「現在の会社に属していないため、モデル オブジェクトへのアクセスが拒否されました」

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

learn-legacy-article-disclaimer-text

問題

  • 一部の freemarker テンプレートには、次のメッセージが表示されます: 「現在の会社 20116 に属していないため、モデル オブジェクトへのアクセスが拒否されました」
  • 再現手順
    1) Liferay DXP 7.3 を Fix Pack 1 でセットアップします。
    2) [
    パネル] → [システム設定] → [テンプレート エンジン]
    に移動します。サイトに戻る
    5) DocumentList.json を ソースとし、TestStructure をタイトルとして構造を作成します
    6) DocumentList_mod.ftl を使用してテンプレートを作成します
    7) Documents and Media→ Document Types→ + sign に移動します
    8 ) タイトル: TestDocumentType
    9) ドキュメントを追加 & メディア フィールド → 保存
    10) 新しい TestDocumentType を追加 → タイトル: TestDDM
    11) 選択をクリック → 画像 (jpg) をアップロード → 保存
    12) TestStructure で Web コンテンツを作成
    13)Documents フィールドに TestDDM を設定→ Publish
    14)ウィジェットページ TestWidgetPage を作成
    15)+ 記号をクリックしてポートレットを追加
    16)Content タブをクリック
    17)TestWebContent を検索してページに配置
    18)チェックポイント: リンクが表示されている: Documents
    19)TestWebContent を再度開く
    20)Documents フィールドをアップロードされた画像 (jpg) に変更→公開
    21) TestWidgetPage に再度アクセスする
    期待される動作: ユーザーはへのリンクを表示できますチェックポイントのステップと同じように、画像。
    観察された動作: サーバー ログおよび Web コンテンツ表示での エラー
  • 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 フィックスパック 1

解決策

追加情報

  • 最初に下位の環境で上記のアクティビティを試し、すべてがうまく機能する場合は、自分の判断で運用環境に移行してください。
  • これらの手順ではサーバーの再起動が必要になるため、これらの操作はアプリケーション サーバーのダウンタイム中に実行してください。
did-this-article-resolve-your-issue

legacy-knowledge-base