Warning message

  • This translation is outdated. For the most up-to-date information, please refer to the English version.
  • This translation is outdated. For the most up-to-date information, please refer to the English version.

JBoss EAP 5 において、PropertyConfigurator を使用して設定した war で log4j を使用する方法

Solution Verified - Updated -

Issue

カスタマーのサイトで、競合するアプリケーションサーバーから移行しようとすると、その Web アプリケーションの WEB-INF フォルダの lib ディレクトリには必ず log4j.jar があります。EAP 5 では、添付した war ファイルで以下のようなエラーが表示されます。

EAP 5.0 Beta 2 のエラーメッセージ:

ERROR [STDERR] log4j:ERROR A "org.jboss.logging.appender.FileAppender" object is not assignable to a "org.apache.log4j.Appender" variable.
ERROR [STDERR] log4j:ERROR The class "org.apache.log4j.Appender" was loaded by
ERROR [STDERR] log4j:ERROR [BaseClassLoader@6f531a15{vfsfile:/Users/jimtyrrell/Servers/jboss-eap-5.0/jboss-as/server/default/deploy/TestApplication.war/}] whereas object of type
ERROR [STDERR] log4j:ERROR "org.jboss.logging.appender.FileAppender" was loaded by
  • この問題の詳細については、以下のリンクを参照してください。

http://www.jboss.org/feeds/post/how_do_i_use_my_own_log4j_properties_or_xml_file_in_jboss
このページによると、lib ディレクトリは *.war/lib の root にはありませんが、実際には lib ディレクトリで jsp を表示することができるため、正しく動作していないように見えます。また、この war 設定ファイルも有効ではありません。上のリンクは一部の Web サイトで実施した内容を説明していますが、きちんと動作していないように見えます。

  • ここで推奨されている方法でこの jboss-app.xml ファイルをテストすると、ロード時にエラーになります。

https://jira.jboss.org/jira/browse/JBAS-1088

Environment

  • JBoss Enterprise Application Platform (EAP) 5.x

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.