Uploaded image for project: 'RHEL'
  1. RHEL
  2. RHEL-62958

tomcat: JAVA_HOME is set unconditionally in tomcat.conf

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Undefined Undefined
    • rhel-9.5.z
    • rhel-9.4
    • tomcat
    • None
    • No
    • Important
    • rhel-sst-middleware
    • None
    • False
    • Hide

      None

      Show
      None
    • None
    • None
    • None
    • None
    • None

      /etc/tomcat/tomcat.conf unconditionally sets the environment variable JAVA_HOME. This variable is generally set conditionally and in this case it should not be set at all and the decision should be left to /usr/share/java-utils/java-functions from the package javapackages-tools.

      This issue was encountered when testing https://issues.redhat.com/browse/RHEL-62177. There is a short transition period when the default OpenJDK change is not implemented on OpenJDK side (/usr/lib/jvm/jre points to Java 11 but javapackages-tools Requires Java 17). This could also cause problems with future changes.

      This package is also the only one out of the roughly 15 packages in RHEL 9 which require javapackages-tools at runtime which sets JAVA_HOME.

      See /etc/tomcat/tomcat.conf in the similar package pki-servlet-engine-9.0.50-1.el9 which does not set JAVA_HOME.

      Steps to reproduce:

      The output should have been:

      $ tomcat-digest
      /usr/bin/build-classpath: Could not find commons-daemon Java extension for this JVM
      /usr/bin/build-classpath: error: Some specified jars were not found
      Usage: RealmBase [-a <algorithm>] [-e <encoding>] [-i <iterations>] [-s <salt-length>] [-k <key-length>] [-h <handler-class-name>] <credentials>
      

      Proposed solution: follow what pki-servlet-engine-9.0.50-1.el9 does and do not set JAVA_HOME at all.

              akrajcik@redhat.com Adam Krajcik
              mkoncek Marián Konček
              Adam Krajcik Adam Krajcik
              Matus Madzin Matus Madzin
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated: