Installation fails even if openjdk-6-jdk is installed

Bug #212521 reported by jablko
28
Affects Status Importance Assigned to Milestone
tomcat5.5 (Debian)
Fix Released
Unknown
tomcat5.5 (Ubuntu)
Fix Released
Medium
Unassigned
Hardy
Fix Released
Undecided
Unassigned

Bug Description

Binary package hint: tomcat5.5

I just installed tomcat5.5 from Hardy. It installed openjdk-6-jre, so the init script failed at line 48 because openjdk-6-jre does not include bin/jdb

As bug #179447 explains, bin/jdb is part of a -jdk vs. a -jre package, and tomcat5.5's dependencies should ensure one is installed. It seems to me this could be achieved by depending on "java2-sdk" instead of "java2-runtime". I added this comment to Debian bug #458412, however I admittedly know little about the Java packaging policy...

In the meantime, I installed openjdk-6-jdk, but the tomcat5.5 init script still fails because line 40 does not include "/usr/lib/jvm/java-6-openjdk":

[/etc/init.d/tomcat5.5 line 40]
JDK_DIRS="/usr/lib/jvm/java-6-sun /usr/lib/jvm/java-1.5.0-sun /usr/lib/j2sdk1.5-sun /usr/lib/j2sdk1.5-ibm /usr/lib/j2sdk1.4-sun /usr/lib/j2sdk1.4-blackdown /usr/lib/j2se/1.4 /usr/lib/j2sdk1.4-ibm /usr/lib/j2sdk1.3-sun /usr/lib/j2sdk1.3-blackdown /usr/lib/jvm/java-gcj /usr/lib/kaffe"

# Look for the right JVM to use
for jdir in $JDK_DIRS; do
[...]

Perhaps a more maintainable way to find the right JVM would be to:

for jdir in /usr/lib/jvm/*; do
[...]

- or perhaps JAVA_HOME=/usr would work, since /usr contains bin/java and bin/jdb. This would keep the default JAVA_HOME consistent with /etc/alternatives

Again, I confess to knowing little about the Java packaging policy.

Thanks for maintaining Tomcat, Jack

Revision history for this message
Matti Lindell (mlind) wrote :

debdiff for Hardy.

Revision history for this message
Matti Lindell (mlind) wrote :

At least java-gcj-compat-dev, sun-java5-jdk, sun-java6-jdk, openjdk-6-jdk were added to provide java2-sdk in Hardy. java2-runtime dependency is wrong which is cause for bug #179447.

I tested the debdiff with openjdk-6 and it worked as expected. Possible backport may cause issues though as Gutsy doesn't have java2-sdk.

Revision history for this message
Daniel Hahler (blueyed) wrote :

Thank you for your patch, Matti.
I've subscribed motu-release to the bug.

Revision history for this message
Scott Kitterman (kitterman) wrote :

Not getting done before release. This may qualify for a post-release SRU. See https://wiki.ubuntu.com/StableReleaseUpdates

Revision history for this message
aidave (aidave) wrote :

I cannot get tomcat5.5 to install with OpenJDK or sun-java6. vERY frustrating

Revision history for this message
Luca Falavigna (dktrkranz) wrote :

Intrepid has version 5.5.26-3, mind preparing a new debdiff against it, if applicable? Please resubscribe u-u-s when ready, thanks!

Changed in tomcat5.5:
assignee: nobody → mlind
importance: Undecided → Medium
status: New → In Progress
Revision history for this message
Sean Hodges (seanhodges) wrote :

Has the debdiff been created for Intrepid? A fix will definitely be desirable, as OpenJDK is getting very popular these days...

An alternative suggestion would be for the init script to prefer the path for javac that is set in the update-alternatives, this has the advantage of allowing a user to change their JAVA_HOME by running update-alternatives --config javac and restarting tomcat...

If someone could let me know the status of this bug I can prepare a diff for the preferred fix...

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

I'm on it. Workaround is to install sun-java6-jdk prior to installing tomcat5.5.

Changed in tomcat5.5:
assignee: mlind → tcarrez
status: In Progress → Triaged
Revision history for this message
Matti Lindell (mlind) wrote :

Thierry, I reckon you should use jdk that's not in multiverse (like default-jdk, java5-sdk, etc.), otherwise tomcat5.5 binary needs to be demoted in to multiverse.

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

Matti:

Of course, that's just a workaround until my fix is ready. Without modifying the init script, sun-java6-jdk is one of the few packages that will make it work...

The final fix will accept any of the java2-runtime-headless providers, including the preferred openjdk-6-jre-headless. Apparently once the initscript is fixed tomcat5.5 works very well with a headless JRE (rather than a full JDK), thanks to the use of libecj-java as the JSP compiler.

I'm including other fixes taken from my tomcat6 packages to improve the average tomcat5.5 usage experience and that should be ready for testing soon !

Thierry Carrez (ttx)
Changed in tomcat5.5:
status: Triaged → In Progress
Revision history for this message
Thierry Carrez (ttx) wrote :

Proposed debdiff

tomcat5.5 (5.5.26-3ubuntu1) intrepid; urgency=low

  * Fix tomcat5.5 Java environment to match status of Java in intrepid:
    - control: Moved Java runtime deps to libtomcat5.5-java
    - control: Depends on default-jre-headless | java2-runtime-headless
    - tomcat5.5.init: Fix JVM list to match java2-runtime-headless
    - rules, control: Builds with default-jdk, libecj-java build-dep added
    - Fixes LP: #212521, LP: #179447
  * tomcat5.5.postinst: Removed superfluous /etc/tomcat5.5/tomcat5.5 linking
  * rules, tomcat5.5.init: implement TearDown spec
  * tomcat5.5.install: don't install catalina.policy (LP: #112626)
  * Fix CVE-2008-1232 cross-site scripting vulnerability (LP: #256926)
  * Fix CVE-2008-2370 information disclosure vulnerability (LP: #256922)
  * Fix CVE-2008-2938 directory traversal (LP: #256802)

 -- Thierry Carrez <email address hidden> Wed, 10 Sep 2008 12:00:09 +0200

Changed in tomcat5.5:
status: Unknown → Fix Committed
Revision history for this message
Thierry Carrez (ttx) wrote :

I don't think this needs a FFe. If the TearDown spec fix and/or the "build with default-jdk" makes it cross the line, let me know, I'd just produce a lighter update.

Changed in tomcat5.5:
assignee: tcarrez → nobody
status: In Progress → Confirmed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package tomcat5.5 - 5.5.26-3ubuntu1

---------------
tomcat5.5 (5.5.26-3ubuntu1) intrepid; urgency=low

  * Fix tomcat5.5 Java environment to match status of Java in intrepid:
    - control: Moved Java runtime deps to libtomcat5.5-java
    - control: Depends on default-jre-headless | java2-runtime-headless
    - tomcat5.5.init: Fix JVM list to match java2-runtime-headless
    - rules, control: Builds with default-jdk, libecj-java build-dep added
    - Fixes LP: #212521, LP: #179447
  * tomcat5.5.postinst: Removed superfluous /etc/tomcat5.5/tomcat5.5 linking
  * rules, tomcat5.5.init: implement TearDown spec
  * tomcat5.5.install: don't install catalina.policy (LP: #112626)
  * Fix CVE-2008-1232 cross-site scripting vulnerability (LP: #256926)
  * Fix CVE-2008-2370 information disclosure vulnerability (LP: #256922)
  * Fix CVE-2008-2938 directory traversal (LP: #256802)

 -- Thierry Carrez <email address hidden> Wed, 10 Sep 2008 12:00:09 +0200

Changed in tomcat5.5:
status: Confirmed → Fix Released
Changed in tomcat5.5:
status: Fix Committed → Fix Released
Revision history for this message
Martin Pitt (pitti) wrote :

Accepted into hardy-proposed, please test and give feedback here. Please see https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you in advance!

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

Tested, on a system where openjdk-6-jdk is already installed:

Without hardy-proposed enabled:
$ sudo apt-get install tomcat5.5 -> FAIL

With hardy-proposed enabled:
$ sudo apt-get install tomcat5.5 -> SUCCESS

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package tomcat5.5 - 5.5.25-5ubuntu1.2

---------------
tomcat5.5 (5.5.25-5ubuntu1.2) hardy-proposed; urgency=low

  * debian/tomcat5.5.init: Add OpenJDK to the JVM list and stop refusing JREs
    so that Tomcat 5.5 starts up correctly with all the java2-runtime providers
    in hardy (LP: #179447, LP: #212521)

 -- Thierry Carrez <email address hidden> Mon, 22 Sep 2008 10:48:30 +0200

Changed in tomcat5.5:
status: Fix Committed → Fix Released
Changed in tomcat5.5 (Debian):
status: Fix Released → New
Changed in tomcat5.5 (Debian):
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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