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

カスタム利用規約で見られるNullPointerExceptionエラー

written-by

Dia Seung

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

問題

  • コントロールパネルのインスタンス構成で「使用条件」のカスタムコンテンツ( )を設定し、新規ユーザーとして初めてログインすると、NullPointerException が発生しました。

Environment

  • DXP 7.4

解決策

  • 利用規約コード は、 コンテンツ id を持つ <section /> タグが存在することを期待し、要求します。この id が見つからない場合、NullPointerException エラーが発生します。
  • Liferay の unstyled theme:のように、テーマが のコンテンツ id を持つ <section /> タグを持っていることを確認してください。
    <section id="content">
    <h2 class="hide-accessible sr-only" role="heading" aria-level="1">${htmlUtil.escape(the_title)}</h2>

    <#if selectable>
    <@liferay_util["include"] page=content_include />
    <#else>
    ${portletDisplay.recycle()}

    ${portletDisplay.setTitle(the_title)}

    <@liferay_theme["wrap-portlet"] page="portlet.ftl">
    <@liferay_util["include"] page=content_include />
    </@>
    </#if>
    </section>
    Liferayのクラシックテーマはタグ宣言が少し違います(それ以外は同じ内容です):
    <section class="${portal_content_css_class} flex-fill" id="content">

追加情報

did-this-article-resolve-your-issue

legacy-knowledge-base