legacy-knowledge-base
公開されました Sep. 10, 2025

DXP 7.4でtomcatでCatalinaのホームパスを取得できない。

written-by

István Gergely-Tárnoki

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

問題

  • DXP 7.4, に移行した後、 ${catalina.base} または ${catalina.home}という変数を使用して、カタリナのホームパスを取得することができません。
  • DXP 7.3 以下で動作していました。

Environment

  • Liferay DXP 7.4

解決策

  • この挙動は、log4j 1.x(DXP 7.3以下)からlog4j 2.x(DXP 7.4)への移行に伴うものです。
  • log4j 1.xとlog4j 2.xでは、ルックアップの構文が異なる。 この記事 は、log4j 2.x 形式に合うようにロギング構成を修正する方法についての提案を含んでいます。 特にこの引用をご覧ください:
    Note that system property interpolation via the ${foo} syntax has been extended to allow property lookups from many different sources. See the Lookups documentation for more details. For example, using a lookup for the system property named catalina.base, in Log4j 1.x, the syntax would be ${catalina.base}. In Log4j 2, the syntax would be ${sys:catalina.base}.
  • ですから、この場合は、ほとんどの場合、修正する必要があります。
    ${catalina.home}
    の代わりに、module-log4j.xml ファイルに次のように記述してください。
    ${sys:catalina.home}
  • 他の変数の参照も同様に、追加で修正する必要があるかもしれません。
did-this-article-resolve-your-issue

legacy-knowledge-base