I have to point people out about an article written by Ceki Gülcü (one of the programmers, maybe the main programmer, that developed Log4j). Ceki Gülcü also wrote the book "The complete Log4j manual". So, I think we can trust the article:
http://www.qos.ch/logging/classloader.jsp Taxonomy of class loader problems encountered when using Jakarta Commons Logging This article clarified everything. In my opinion, the article is extremely important. After running all those examples, now I am capable of comprehending how, in fact, the classloading mechanism in Tomcat works. Well, not only in Tomcat, but in Java platform itself as well. The classloading problem is not limited to a free web container like Tomcat. It can possibly happen in, for example, WebSphere, or any other commercial application server. That´s because this problem is not related to the web container, but to the Java platform itself, actually. In fact, citing another example, a very common problem when using webservices, that is also related to the parent/child classloading relationship is: java.lang.NoSuchMethodError: javax/wsdl/PortType.getExtensionAttributes()Ljava/util/Map This problem can happen when a different version of wsdl4j-XXX.jar is placed in a parent classpath directory, comparing to the version placed in the child classpath directory. It doesn´t matter how web container, free or commercial, is being used. Now I can understand how the classloading mechanism can cause bugs, if it is not used correctly. In the Ceki Gülcü´s article, it is strongly recommended to NOT include commons-logging.jar and log4j.jar in the web-applications' WEB-INF/lib/ directory, if Tomcat is used. Well, although this recommendation be the best practice, I am not following this rule exactly, due to some restrictions in my environment. I do include those two jars in the WEB-INF/lib/ directory (contradicting the recommendation). I just have to guarantee that those two jars are not in a shared classpath directory either, that would be a "parent classpath directory" (in Tomcat, it would be, for example, the [CATALINA_HOME]/shared/lib/ directory). I am sure that it works without problems because I run all those examples in the Ceki Gülcü´s article and I understood all of them. -- View this message in context: http://www.nabble.com/Axis2-and-Tomcat-5.0.28-commons-logging-api-tp19242773p20781902.html Sent from the Axis - User mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
