This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
We are using Tomcat 4.1 and jdk 1.4.2. We have written some customized handlers and formatters, these classes are contained in a common Jar file. The only way we can get Tomcat to see the jar file is if it resides in the Java JRE's lib\ext directory. We have tried classpathing the jar but, it seems that Tomcat's initial startup does not see the jar resulting ain a ClassNotFoundException.
Putting the jar in the "ext" directory is OK but, we run into dependencies that now require additional jar files to be included there as well. Also, classes that reside in web applications can run into class loader issues because the common jar has been loaded by a different class loader.
My question is...have we missed the point with Tomcat? Is there a different approach that we should consider in having Tomcat see the jar file. We're new to using Tomcat and are not too familiar with its nuances.
"The LogManager object is created during class initialization"
"At startup the LogManager class is located using the java.util.logging.manager system property"
"Note that all classes loaded during LogManager configuration must be on the system class path" (the question you asked)
and others that combine to suggest that there is only one LogManager object per JVM. In other words, it is a centralized logging facility. If you have several web applications and you want to configure logging for them, you have to go to the single centralized configuration file and modify that.
If you prefer to manage logging separately for each web application, and provide handlers in a jar file that is part of the web application, then I recommend you use log4J instead. That's what I do.
Joined: Aug 08, 2003
Thanks...I really appreciate the input. I've seperated the classes into their own jar file and included them on the boot class path. I still don't fully see why the classes are not seen by the classpath when the jvm starts up though.