legacy-knowledge-base
公開されました Jun. 30, 2025

通知テンプレートのFreemarkerエラー

written-by

Jamilly Macedo

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テンプレートを使用した電子メール通知を関連付けると、通知が送信されないエラーが発生することがあります。

  • ログには次のようなエラーが報告されている:

Caused by: com.liferay.portal.kernel.log.LogSanitizerException: freemarker.core.InvalidReferenceException: The following has evaluated to null or missing:_==> titulo [in template "com.liferay.notification.model.NotificationTemplate#63272" at line 1, column 3]__----_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: ${titulo.getData()} [in template "com.liferay.notification.model.NotificationTemplate#63272" at line 1, column 1]_---- [Sanitized]
at freemarker.core.InvalidReferenceException.getInstance(InvalidReferenceException.java:134) ~[?:?]
at freemarker.core.UnexpectedTypeException.newDescriptionBuilder(UnexpectedTypeException.java:85) ~[?:?]
at freemarker.core.UnexpectedTypeException.<init>(UnexpectedTypeException.java:48) ~[?:?]
at freemarker.core.NonHashException.<init>(NonHashException.java:49) ~[?:?]
at freemarker.core.Dot._eval(Dot.java:48) ~[?:?]
at freemarker.core.Expression.eval(Expression.java:101) ~[?:?]
at freemarker.core.MethodCall._eval(MethodCall.java:55) ~[?:?]
at freemarker.core.Expression.eval(Expression.java:101) ~[?:?]
at freemarker.core.DollarVariable.calculateInterpolatedStringOrMarkup(DollarVariable.java:100) ~[?:?]
at freemarker.core.DollarVariable.accept(DollarVariable.java:63) ~[?:?]
at freemarker.core.Environment.visit(Environment.java:331) ~[?:?]
at freemarker.core.Environment.process(Environment.java:310) ~[?:?]
at freemarker.template.Template.process(Template.java:383) ~[?:?]
at com.liferay.portal.template.freemarker.internal.FreeMarkerTemplate.lambda$processTemplate$0(FreeMarkerTemplate.java:148) ~[?:?]
at com.liferay.portal.template.freemarker.internal.FreeMarkerManager.render(FreeMarkerManager.java:429) ~[?:?]
at com.liferay.portal.template.freemarker.internal.FreeMarkerTemplate.processTemplate(FreeMarkerTemplate.java:135) ~[?:?]
at com.liferay.portal.template.engine.BaseTemplate.processTemplate(BaseTemplate.java:117) ~[?:?]
... 154 more

環境

  • Liferay DXP 7.4

解像度

  • この問題は LPS-203970によって解決されている。
  • この問題を修正したHotfixをリクエストしてください。

追加情報

did-this-article-resolve-your-issue

legacy-knowledge-base