tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject [Bug 54601] New: should not modify $JAVA_OPTS to add $LOGGING_MANAGER
Date Fri, 22 Feb 2013 17:24:27 GMT

            Bug ID: 54601
           Summary: should not modify $JAVA_OPTS to add
           Product: Tomcat 6
           Version: 6.0.36
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Native:Integration
    Classification: Unclassified

See and for background. Reproduced in
6.0.36 though reported also in Tomcat 7.

If you set an environment variable $JAVA_OPTS (say, ‘export JAVA_OPTS=-server’)
before running, the Catalina JVM will include an environment
variable JAVA_OPTS set to e.g. ‘-server
-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager’. (This is
not true if you do _not_ set JAVA_OPTS yourself: will modify a
local shell variable but it does not export it.)

Normally this is harmless. But if the web application happens to fork an
external process which happens to be one of the many Java applications that
interpret $JAVA_OPTS when defined as JVM parameters, and that application uses
java.util.logging at any point, then that application will generally crash
because ClassLoaderLogManager is not in its classpath.

Indeed we did not really want to be passing
-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager to the
subprocess. If the user decided to specify some JAVA_OPTS for Tomcat, we should
either pass this var unmodified to the JVM, or not pass it at all.

The fix seems simple enough (patch format upon request): in,

if [ -z "$LOGGING_MANAGER" ]; then


if [ -z "$LOGGING_MANAGER" ]; then

and then replace subsequent references to $JAVA_OPTS with $CATALINA_JAVA_OPTS.
Optionally also


since any JVM options specified for the web server are likely to be
inappropriate for other Java processes it spawns (though suggests otherwise).

The workaround in the web application is to sanitize the JAVA_OPTS environment
variable before forking the subprocess, deleting the ClassLoaderLogManager
configuration if found.

You are receiving this mail because:
You are the assignee for the bug.
To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message