Jakarta Commons Logging が WebApp を開放してくれない件

| コメント(0) | トラックバック(0)

Taxonomy of class loader problems with Jakarta Commons Logging

tomcatで開発をしている時に、コンテキストの更新を何度も行うとOutOfMemoryErrorが発生することがあるので、いろいろ調べていたところ、このページを見つけました。
JCLの、ClassLoaderが絡んだ場合の挙動についてサンプル付きで詳しく説明してあります。

回り道日記 - WebappClassLoader が解放されない件の原因1にて、

  1. TOMCAT_HOME/bin/commons-logging-api.jar を commons-logging-1.0.4.jar で置きかえる (同名にして上書き)
  2. TOMCAT_HOME/common/endorsed に log4j.jar を置く

とのことでしたが、これの理由というわけでした。

ただ、今回紹介されている方法はちょっと違いまして、

For Tomcat 5.0.27 and later, Make sure you are using JCL version 1.0.4 or later. Tomcat version 5.0.x ships with an outdated version of JCL.
  1. Leave the file TOMCAT_HOME/bin/commons-logging-api.jar as is. In particular, do not remove it.
  2. Place the files commons-logging.jar and log4j.jar in the directory TOMCAT_HOME/commons/lib/.
  3. Do not include any other copies of commons-logging.jar and log4j.jar in your web-applications' WEB-INF/lib/ directory.
  4. Do not set the system properties org.apache.commons.logging.LogFactory or org.apache.commons.logging.Log.

というわけで、common/libを利用するというもの。
でも、この方法だと、コンテキスト別のlog4jの設定が効かないのです。。。

はて、、、

トラックバック(0)

トラックバックURL: http://happy-camper.st/mt/mt-tb.cgi/353

コメントする

2012年1月

1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30 31        

月別 アーカイブ

CLOCK

あわせて読みたい

あわせて読みたい

ブログ通信簿

Yahoo!天気情報

AdSense

フィードメーター

RSS feed meter for http://ueshin.happy-camper.st/

トラックフィード

Creative Commons License
このブログはクリエイティブ・コモンズでライセンスされています。
Powered by Movable Type 4.2-ja