Ubuntu

Installation of tomcat5.5 fails if openjdk-6 or a JRE is installed

Reported by Ralph Janke on 2007-12-30
124
Affects Status Importance Assigned to Milestone
tomcat5.5 (Debian)
Fix Released
Unknown
tomcat5.5 (Ubuntu)
Medium
Thierry Carrez
Hardy
High
Unassigned

Bug Description

Binary package hint: tomcat5.5

Hardy Release: Current as of 20071230 via dist-upgrade

Without any JDK installed, tomcat5.5 installation installs:

The following extra packages will be installed:
  ecj jsvc libcommons-daemon-java libecj-java libgcj8-jar
Suggested packages:
  libapache-mod-jk libapache2-mod-jk tomcat5.5-webapps tomcat5.5-admin
Recommended packages:
  ecj-gcj libecj-java-gcj
The following NEW packages will be installed
  ecj jsvc libcommons-daemon-java libecj-java libgcj8-jar tomcat5.5
0 upgraded, 6 newly installed, 0 to remove and 2 not upgraded.
Need to get 11.3MB of archives.
After unpacking 13.2MB of additional disk space will be used.
Do you want to continue [Y/n]?
Get: 1 http://gb.archive.ubuntu.com hardy/main libecj-java 3.3.0+0728-5 [1158kB]
Get: 2 http://gb.archive.ubuntu.com hardy/main libgcj8-jar 4.2.2-3ubuntu2 [10.0MB]
Get: 3 http://gb.archive.ubuntu.com hardy/main ecj 3.3.0+0728-5 [13.6kB]
Get: 4 http://gb.archive.ubuntu.com hardy/universe libcommons-daemon-java 1.0.2~svn20061127-6 [38.9kB]
Get: 5 http://gb.archive.ubuntu.com hardy/universe jsvc 1.0.2~svn20061127-6 [23.7kB]
Get: 6 http://gb.archive.ubuntu.com hardy/universe tomcat5.5 5.5.25-1ubuntu1 [60.0kB]
Fetched 11.3MB in 39s (290kB/s)
Selecting previously deselected package libecj-java.
(Reading database ... 202930 files and directories currently installed.)
Unpacking libecj-java (from .../libecj-java_3.3.0+0728-5_all.deb) ...
Selecting previously deselected package libgcj8-jar.
Unpacking libgcj8-jar (from .../libgcj8-jar_4.2.2-3ubuntu2_all.deb) ...
Selecting previously deselected package ecj.
Unpacking ecj (from .../ecj_3.3.0+0728-5_i386.deb) ...
Selecting previously deselected package libcommons-daemon-java.
Unpacking libcommons-daemon-java (from .../libcommons-daemon-java_1.0.2~svn20061127-6_all.deb) ...
Selecting previously deselected package jsvc.
Unpacking jsvc (from .../jsvc_1.0.2~svn20061127-6_i386.deb) ...
Selecting previously deselected package tomcat5.5.
Unpacking tomcat5.5 (from .../tomcat5.5_5.5.25-1ubuntu1_all.deb) ...
Setting up libecj-java (3.3.0+0728-5) ...
Setting up libgcj8-jar (4.2.2-3ubuntu2) ...
Setting up ecj (3.3.0+0728-5) ...

Setting up libcommons-daemon-java (1.0.2~svn20061127-6) ...

Setting up jsvc (1.0.2~svn20061127-6) ...
Setting up tomcat5.5 (5.5.25-1ubuntu1) ...
Adding system user `tomcat55' (UID 117) ...
Adding new user `tomcat55' (UID 117) with group `nogroup' ...
Not creating home directory `/usr/share/tomcat5.5'.
 * no JDK found - please set JAVA_HOME
invoke-rc.d: initscript tomcat5.5, action "start" failed.
dpkg: error processing tomcat5.5 (--configure):
 subprocess post-installation script returned error exit status 1
Errors were encountered while processing:
 tomcat5.5
E: Sub-process /usr/bin/dpkg returned an error code (1)

WIth the sun-java6-jdk installed this problem does not occur.

--
In fact the problem is more general : on a system where openjdk-6-jdk, openjdk-6-jre, java-gcj-compat or sun-java6-jre is installed but not java-gcj-compat-dev or sun-java6-jdk, then install will fail. This is because the "java2-runtime" dependency would be satisfied but the init script of Tomcat5.5 would not recognize them as a valid JAVA_HOME.

Ralph Janke (txwikinger) wrote :

The installation by itself seem to work, but the start attempt of tomcat fails. Maybe the dependencies should be adjust such that a JDK can be found by tomcat and the start does not fail.

description: updated
Matti Lindell (mlind) wrote :

I forwarded this issue to Debian bug tracker. This could be solved by making java2-compiler (instead of java2-runtime) a dependency of tomcat5.5 or by ignoring failed invoke-rc.d calls.

Changed in tomcat5.5:
importance: Undecided → Low
status: New → Confirmed
Changed in tomcat5.5:
status: Unknown → New
Matti Lindell (mlind) on 2008-02-11
Changed in tomcat5.5:
importance: Low → Medium
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: nobody → tcarrez
status: Confirmed → Triaged
Thierry Carrez (ttx) on 2008-09-09
Changed in tomcat5.5:
status: Triaged → In Progress

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: In Progress → Fix Released
Thierry Carrez (ttx) wrote :

SRU report

Bug impact: Makes tomcat5.5 uninstallable on most systems (only works on systems without any JVM installed at all or with sun-java6-jdk preinstalled).

Intrepid bugfix: Was fixed in 5.5.26-3ubuntu1 (see changelog just above)

Minimal patch: see below.

TEST CASE:
On a newly-installed hardy system (without java-gcj-compat-dev or sun-java6-jdk installed), any of these installation commands will fail with "no JDK found - please set JAVA_HOME" error :
$ sudo apt-get install java-gcj-compat tomcat5.5
$ sudo apt-get install sun-java6-jre tomcat5.5
$ sudo apt-get install openjdk-6-jdk tomcat5.5
$ sudo apt-get install openjdk-6-jre tomcat5.5
With the updated package, installation succeeds in all cases and Tomcat 5.5 runs properly.

Regression potential:
The patch enables two things: add /usr/lib/jvm/java-6-openjdk to the list of potentially-used JVMs and allow to run with a JRE and not necessarily a JDK (to match the providers of the existing "java2-runtime" runtime dependency). In both cases, it allows to install and run on systems where installation would currently simply fail, so the regression potential is minimal. Furthermore, I thoroughly tested that Tomcat 5.5 could install and run properly with any of the java2-runtime providers, so this should not introduce other bugs.

Thierry Carrez (ttx) wrote :

Proposed hardy SRU debdiff

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

Emmet Hikory (persia) on 2008-10-10
Changed in tomcat5.5:
assignee: nobody → tcarrez
Thierry Carrez (ttx) on 2008-10-23
Changed in tomcat5.5:
importance: Undecided → High
status: New → Confirmed
Thierry Carrez (ttx) on 2008-10-23
description: updated

Ack.

Thierry Carrez (ttx) on 2008-10-28
Changed in tomcat5.5:
assignee: tcarrez → nobody
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: Confirmed → Fix Committed
Thierry Carrez (ttx) wrote :

Tested:
Without hardy-proposed enabled:
$ sudo apt-get install java-gcj-compat tomcat5.5 -> FAIL
$ sudo apt-get install sun-java6-jre tomcat5.5 -> FAIL
$ sudo apt-get install openjdk-6-jdk tomcat5.5 -> FAIL
$ sudo apt-get install openjdk-6-jre tomcat5.5 -> FAIL

With hardy-proposed enabled:
$ sudo apt-get install java-gcj-compat tomcat5.5 -> SUCCESS
$ sudo apt-get install sun-java6-jre tomcat5.5 -> SUCCESS
$ sudo apt-get install openjdk-6-jdk tomcat5.5 -> SUCCESS
$ sudo apt-get install openjdk-6-jre tomcat5.5 -> SUCCESS

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: New → Confirmed
C de-Avillez (hggdh2) on 2011-09-02
Changed in tomcat5.5 (Ubuntu):
status: Fix Released → Won't Fix
C de-Avillez (hggdh2) on 2011-09-02
Changed in tomcat5.5 (Ubuntu):
status: Won't Fix → Fix Released
Changed in tomcat5.5 (Debian):
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

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