Make it clearer that JAVA_OPTS is about JSVC options

Bug #440685 reported by alan
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
tomcat6 (Ubuntu)
Fix Released
Wishlist
Thierry Carrez

Bug Description

JAVA_OPTS is somewhat misleading since it is JSVC options and not all Java options are recognized, which leads to bug reports like :

I put that in /etc/default/tomcat5.5:
JAVA_OPTS="-Xmx1024m -enableassertions -server -XX:MaxPermSize=512m
-XX:+CMSPermGenSweepingEnabled -XX:+CMSClassUnloadingEnabled
-Djava.awt.headless=true"

But I got this message:
Invalid option -enableassertions

Then I move to:
JAVA_OPTS="-Xmx1024m -ea -server -XX:MaxPermSize=512m
-XX:+CMSPermGenSweepingEnabled -XX:+CMSClassUnloadingEnabled
-Djava.awt.headless=true"

and I got:
Invalid option -server

Then, if I remove '-server':
JAVA_OPTS="-Xmx1024m -ea -XX:MaxPermSize=512m
-XX:+CMSPermGenSweepingEnabled -XX:+CMSClassUnloadingEnabled
-Djava.awt.headless=true"

tomcat finally starts.

But why that? and how can I be sure that tomcat is running with
assertions and server enabled?

Revision history for this message
alan (alanwilter) wrote :
Revision history for this message
Thierry Carrez (ttx) wrote :

Sounds like a JVM bug: What JVM are you using ? Could you try passing those options directly to "java" to test how it reacts ?

Changed in tomcat5.5 (Ubuntu):
importance: Undecided → Low
status: New → Incomplete
Revision history for this message
alan (alanwilter) wrote :

I am using:

java version "1.6.0_16"
Java(TM) SE Runtime Environment (build 1.6.0_16-b01)
Java HotSpot(TM) 64-Bit Server VM (build 14.2-b01, mixed mode)

And I have the same problem with openJDK. It's not java for sure.

Putting in the command line it seems pretty fine:

java -Xmx1024m -enableassertions -server -XX:MaxPermSize=512m -XX:+CMSPermGenSweepingEnabled -XX:+UseConcMarkSweepGC -XX:+CMSClassUnloadingEnabled -Djava.awt.headless=true -Dorg.apache.jasper.runtime.BodyContentImpl.LIMIT_BUFFER=true -version
Please use CMSClassUnloadingEnabled in place of CMSPermGenSweepingEnabled in the future
java version "1.6.0_16"
Java(TM) SE Runtime Environment (build 1.6.0_16-b01)
Java HotSpot(TM) 64-Bit Server VM (build 14.2-b01, mixed mode)

Thierry Carrez (ttx)
Changed in tomcat5.5 (Ubuntu):
status: Incomplete → New
Revision history for this message
Thierry Carrez (ttx) wrote :

Reproduced with OpenJDK / tomcat6 / Ubuntu 9.10

The issue here is that you are not passing java options, but jsvc options.
jsvc accepts -X and -D options and passes them to the underlying JVM. It does not recognize -enableassertions or -server (see man jsvc). It recognizes -ea for -enableassertions though (undocumented, found in 1.0.1 release notes).

Note that OpenJDK uses -server by default so it should not be needed if you used OpenJDK. Not sure about Sun's JVM, but it might have the same default.

So this is not a bug, but maybe we need to document that a little better since the name is misleading (JAVA_OPTS).

affects: tomcat5.5 (Ubuntu) → tomcat6 (Ubuntu)
Changed in tomcat6 (Ubuntu):
importance: Low → Wishlist
status: New → Triaged
summary: - "-enableassertions -server" not working with tomcat 5.5.26 in Ubuntu
- 9.04
+ Make it clearer that JAVA_OPTS is about JSVC options
description: updated
Thierry Carrez (ttx)
Changed in tomcat6 (Ubuntu):
assignee: nobody → Thierry Carrez (ttx)
status: Triaged → In Progress
Revision history for this message
Launchpad Janitor (janitor) wrote :
Download full text (4.2 KiB)

This bug was fixed in the package tomcat6 - 6.0.20-8ubuntu1

---------------
tomcat6 (6.0.20-8ubuntu1) lucid; urgency=low

  * Merge from Debian unstable. Remaining changes:
    - debian/control, debian/rules: Do not use 3.0 (quilt) source format yet
  * debian/tomcat6.default: Fix typos in "JSVC" and "remote", missing newline
  * debian/tomcat6.default, debian/tomcat6.init: Handle JSVC_CLASSPATH
    default value the same way as other defaults

tomcat6 (6.0.20-8) unstable; urgency=low

  * Corrected some spelling mistakes in debian/control.
    (Closes: #557377, #557378)
  * Added patches to install the OSGi metadata in some of the jars.
    (Closes: #558176)
  * Updated 03catalina.policy to allow "setContextClassLoader".
    - Fixes a problem where Sun's JVM would fail to generate log-files.
    (Closes: LP: #410379)
  * Updated /etc/default/tomcat6:
    - Clarified that JAVA_OPTS are passed to jscv and not the JVM.
    - Updated the JSP_COMPILER to javac (jikes is not in Debian anymore).
    (Closes: LP: #440685)
  * Use default-jdk and default-jre-headless instead of openjdk in
    (Build-)Depends.
  * Added more alternatives for java implementations to the Depends of
    libservlet2.5-java.
  * Exposed JSVC_CLASSPATH to the configuration file.
    (Closes: LP: #475457)
  * Updated description so it no longer refers to non-existent package.
    (Closes: #559475)
  * Used "set -e" in postinst and postrm instead of passing "-e" to sh
    in the #!-line.
  * Changed to 3.0 (quilt) source format.

tomcat6 (6.0.20-7) unstable; urgency=low

  * New patch fix_context_name.patch:
    - Allow Service name != Engine name. Regression in fix for 42707.
      Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=47316
    - This has been fixed in trunk and will be in 6.0.21
  * Register libservlet2.5-java-doc API with doc-base
  * Fix short description of tomcat6-docs by using "documentation" suffix

tomcat6 (6.0.20-6) unstable; urgency=low

  [ Ludovic Claude ]
  * tomcat6.postinst: set the ownership of files in /etc/tomcat6/
    to root:tomcat6, to prevent an attacker running inside a tomcat6
    instance to change the tomcat configuration
  * debian/policy/02debian.policy: grant access to
    /usr/share/maven-repo/ as it is a valid source of Debian JARs.
    (Closes: #545674)
  * Bump up Standards-Version to 3.8.3
    - add debian/README.source that describes the quilt patch system.
  * debian/control: Add Conflicts on libtomcat6-java with old versions
    of tomcat6-common (Closes: #542397)

  [ Michael Koch ]
  * Replace dh_clean -k by dh_prep.
  * Added Ludovic and myself to Uploaders.
  * Build-Depends on debhelper >= 7.

tomcat6 (6.0.20-5) unstable; urgency=low

  * Fix jsp-api dependency in the Maven descriptors.
  * Put tomcat-juli.jar in /usr/share/java instead of juli.jar.
    This fixes a broken link which prevented tomcat to start
    when logging is turned on, and restores the file layout
    defined in 6.0.20-2.
  * Restore links to the jars in usr/share/tomcat6/lib
  * Change watch to download fresh sources from SVN.
    Should fix wrong encoding in tomcat-i18n-fr/es.jar in the next upstream
    version. (Closes: #522067)
  * Update ...

Read more...

Changed in tomcat6 (Ubuntu):
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.