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

日付フィールドを含む新しい構造を作成すると、Freemarker エラーが発生する

投稿者

Rita Schaff

knowledge-article-header-disclaimer-how-to

knowledge-article-header-disclaimer

legacy-article

learn-legacy-article-disclaimer-text

問題

  • 日付フィールドを含む新しい構造を作成して保存しようとすると、次のようなエラーが表示されます。
    Error executing FreeMarker template
    FreeMarker template error:
    The following has evaluated to null or missing:
    ==> staticUtil [in template "com.liferay.dynamic.data.mapping.service_4.1.0_CLASS_LOADER_CONTEXT_com/liferay/dynamic/data/mapping/service/dependencies/ddm/date.ftl" at line 4, column 16]

    ----
    Tip: If the failing expression is known to legally refer to something that's sometimes null or missing, either specify a default value like myOptionalVar!myDefault, or use <#if myOptionalVar??>when-present<#else>when-missing</#if>. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)??
    ----

    ----
    FTL stack trace ("~" means nesting-related):
    - Failed at: DATE = staticUtil["java.util.Calendar... [in template "com.liferay.dynamic.data.mapping.service_4.1.0_CLASS_LOADER_CONTEXT_com/liferay/dynamic/data/mapping/service/dependencies/ddm/date.ftl" at line 4, column 9]

Environment

  • DXP 7.2

解決策

  • これは、Freemarker Engine の設定に、制限された変数に特定の変数が含まれているために発生します。
  • これを解決するには、 システム設定テンプレート エンジンFreemarker Engine に移動し、 の制限された変数から staticUtil を削除してください。 新しい設定を保存し、Liferay を再起動します。
did-this-article-resolve-your-issue

legacy-knowledge-base