简体   繁体   中英

Multiple instances of tomcat-juli.jar in Tomcat

Environment: Windows 2003 32-bit (I know, I know we are moving to 64-bit, but soon)

  • Apache Tomcat
  • 6.0.35
  • JAVA_HOME
  • CATALINA_HOME

are configured

Going to the Java tab of Tomcat6w.exe we see:

C:\tomcat\bin\tomcat-juli.jar;
C:\tomcat\bin\tomcat-juli.jar;
C:\tomcat\bin\bootstrap.jar

Why is there more than one instance of: tomcat-juli.jar?

Understand that Juli is: Java Utility Logging Implementation

My question is that even though there is one juli defined.. Why is there two? Do we just keep it at two and the let the system run it's course?

It is "Java Util Logging Implementation" named after the java.util.logging package in the JRE.

JULI is a essentially repackaged Apache Commons Logging with all of the framework detection code removed and hard coded to use a particular logging framework. By default it uses jul but there is also a version that uses log4j in the extras downloads.

There is a reason for the double entry you see but first I need to explain some background.

Tomcat supports an "Advanced" configuration where the binaries are separated from the instances so you can have multiple Tomcat instances ($CATALINA_BASE) using the same set of binaries ($CATALINA_HOME). This makes upgrades very simple. In this advanced configuration it is possible that different instances may want to use different JULI versions. Eg while some use the standard jul bundle, others may wish to use the log4j bundle. To support this, per instance JULI JARs may be placed in $CATALINA_BASE/bin which override the ones in $CATALINA_HOME/bin. The classpath search order is therefore $CATALINA_BASE/bin:$CATALINA_HOME/bin: etc.

In a standard installation $CATALINA_BASE == $CATALINA_HOME so it looks like the JULI JAR has been added twice.

It is safe to leave the second entry but it is also safe to remove it if you wish.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM