Bug 238343

Summary: redundant jars in tomcat5 5.5.17
Product: [Retired] Red Hat Web Application Stack Reporter: David Rabinowitz <david>
Component: distributionAssignee: David Knox <dknox>
Status: CLOSED CURRENTRELEASE QA Contact: Len DiMaggio <ldimaggi>
Severity: medium Docs Contact:
Priority: medium    
Version: v1CC: jclere, mgiles
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-10-20 17:24:53 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description David Rabinowitz 2007-04-29 17:10:32 UTC
In the tomcat5 5.5.17 there are three redundant jars in the package:
/var/lib/tomcat5/server/lib/[jaas].jar
/var/lib/tomcat5/common/lib/[jdbc-stdext].jar
/var/lib/tomcat5/common/lib/[jndi].jar

The reason they are redundant is that these jars are included in Java's rt.jar,
and therefore not needed. Also, in the tomcat distribution (from Apache) they
do not exist. putting them causes errors from /usr/bin/rebuild-jar-repository

Comment 1 Marcelo Giles 2008-04-23 20:35:24 UTC
Having this error messages on RHEL 5.1 and tomcat5-5.5.23-0jpp.3.0.3.el5_1-x86_64

# service tomcat5 restart waiting for processes to exit                        
     [  OK  ]  
waiting for processes to exit  
waiting for processes to exit  
Starting tomcat5: /usr/bin/rebuild-jar-repository: error: could not find
jdbc-stdext Java extension for this JVM  
/usr/bin/rebuild-jar-repository: error: could not find jndi Java extension for
this JVM  
/usr/bin/rebuild-jar-repository: error: All detected jars were not found for
this jvm  
/usr/bin/rebuild-jar-repository: error: could not find jaas Java extension for
this JVM  
/usr/bin/rebuild-jar-repository: error: All detected jars were not found for
this jvm  
                                                          [  OK  ]  

tomcat5.conf

# tomcat5 service configuration file

# you could also override JAVA_HOME here
# Where your java installation lives
#JAVA_HOME="/usr/lib/jvm/java"
#JAVA_HOME="/usr/java/jdk1.5.0_14"
#JRE_HOME="/usr/java/jdk1.5.0_14/jre"
JAVA_HOME="/usr/java/jdk1.6.0_05"
JRE_HOME="/usr/java/jdk1.6.0_05/jre"

# alternatives --display java
java - status is manual.
link currently points to /usr/java/jdk1.6.0_05/bin/java
/usr/lib/jvm/jre-1.4.2-gcj/bin/java - priority 1420
slave keytool: /usr/lib/jvm/jre-1.4.2-gcj/bin/keytool
slave rmiregistry: /usr/lib/jvm/jre-1.4.2-gcj/bin/rmiregistry
slave jre_exports: /usr/lib/jvm-exports/jre-1.4.2-gcj
slave jre: /usr/lib/jvm/jre-1.4.2-gcj
/usr/java/jdk1.5.0_14/jre/bin/java - priority 1
slave keytool: (null)
slave rmiregistry: (null)
slave jre_exports: (null)
slave jre: (null)
/usr/java/jdk1.6.0_05/bin/java - priority 2
slave keytool: (null)
slave rmiregistry: (null)
slave jre_exports: (null)
slave jre: (null)
Current `best' version is /usr/lib/jvm/jre-1.4.2-gcj/bin/java. 

Comment 2 Thomas Fitzsimmons 2008-04-23 21:25:08 UTC
Can you post the output of:

ls -l /usr/lib/jvm-exports/java-1.4.2-gcj-1.4.2.0/


Comment 3 Thomas Fitzsimmons 2008-04-23 21:43:18 UTC
Missed this:

JAVA_HOME="/usr/java/jdk1.6.0_05"
JRE_HOME="/usr/java/jdk1.6.0_05/jre"

You'll need to retry against JPackage-style JDK packages.  For example
java-1.6.0-sun in the RHEL-5 Supplementary RHN channel.

Comment 5 David Walluck 2008-04-23 23:34:28 UTC
In response to comment #1, those links exist for compatibility with other JVM
vendors/versions. A broken link in this case is harmless and the errors can be
safely ignored, but it should point to rt.jar of the currently selected JVM
alternative.

In response to comment #2, JAVA_HOME is being set to a JVM that does not look
like one that we support. You should be installing something like java-1.6.0-sun
that is JPackage-compatible and will provide the symlinks which should not be
broken.

If you are using a proper RPM package, you should not see errors with
rebuild-jar-repository. Can you post the output of:

$ ls -l /var/lib/tomcat5/common/lib
$ /usr/sbin/update-alternatives --display java | grep currently
$ /usr/sbin/update-alternatives --display javac | grep currently


Comment 6 Marcelo Giles 2008-04-24 22:53:21 UTC
Thanks Thomas and David for your replies.

I'll post the info as soon as I get it. Sorry, this a customer's system.
I think he hasn't installed the java-1.6.0-sun package from RHN. Have to confirm.

Comment 7 Marcelo Giles 2008-04-25 13:53:40 UTC
Requested info:

# ls -l /var/lib/tomcat5/common/lib
total 0
lrwxrwxrwx 1 root root 23 Apr 24 13:37 [ant].jar -> /usr/share/java/ant.jar
lrwxrwxrwx 1 root root 39 Apr 24 13:37 [commons-collections].jar ->
/usr/share/java/commons-collections.jar
lrwxrwxrwx 1 root root 32 Apr 24 13:37 [commons-dbcp].jar ->
/usr/share/java/commons-dbcp.jar
lrwxrwxrwx 1 root root 30 Apr 24 13:37 [commons-el].jar ->
/usr/share/java/commons-el.jar
lrwxrwxrwx 1 root root 39 Apr 24 13:37 [commons-logging-api].jar ->
/usr/share/java/commons-logging-api.jar
lrwxrwxrwx 1 root root 32 Apr 24 13:37 [commons-pool].jar ->
/usr/share/java/commons-pool.jar
lrwxrwxrwx 1 root root 23 Apr 24 13:37 [jaf].jar -> /usr/share/java/jaf.jar
lrwxrwxrwx 1 root root 36 Apr 24 13:37 [jasper5-compiler].jar ->
/usr/share/java/jasper5-compiler.jar
lrwxrwxrwx 1 root root 35 Apr 24 13:37 [jasper5-runtime].jar ->
/usr/share/java/jasper5-runtime.jar
lrwxrwxrwx 1 root root 28 Apr 24 13:37 [javamail].jar ->
/usr/share/java/javamail.jar
lrwxrwxrwx 1 root root 38 Apr 24 13:37 [jdbc-stdext].jar ->
/could/not/find/extension/for/this/jvm
lrwxrwxrwx 1 root root 44 Apr 11 14:19 jdbc-stdext.jar ->
/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre/lib/
lrwxrwxrwx 1 root root 27 Apr 10 18:12 jdtcore.jar -> /usr/share/java/jdtcore.jar
lrwxrwxrwx 1 root root 38 Apr 24 13:37 [jndi].jar ->
/could/not/find/extension/for/this/jvm
lrwxrwxrwx 1 root root 23 Apr 24 13:37 [jsp].jar -> /usr/share/java/jsp.jar
lrwxrwxrwx 1 root root 23 Apr 24 13:37 [jta].jar -> /usr/share/java/jta.jar
lrwxrwxrwx 1 root root 29 Apr 24 13:37 [mx4j][mx4j].jar ->
/usr/share/java/mx4j/mx4j.jar
lrwxrwxrwx 1 root root 42 Apr 10 18:12 naming-factory.jar ->
/usr/share/java/tomcat5/naming-factory.jar
lrwxrwxrwx 1 root root 44 Apr 10 18:12 naming-resources.jar ->
/usr/share/java/tomcat5/naming-resources.jar
lrwxrwxrwx 1 root root 27 Apr 24 13:37 [servlet].jar -> /usr/share/java/servlet.jar 

]# /usr/sbin/update-alternatives --display javac | grep currently
link currently points to /usr/lib/jvm/java-1.4.2-gcj/bin/javac

# /usr/sbin/update-alternatives --display java | grep currently
link currently points to /usr/java/jdk1.6.0_05/bin/java 

Comment 8 David Walluck 2008-04-25 18:51:03 UTC
Thanks for the info. Can you also post the output of:

$ ls -lR /usr/lib/jvm-exports
$ rpm -qi `rpm -qf /usr/java/jdk1.6.0_05/bin/java`

I think what we have here is likely a Sun rpm that does not provide any of the
requisite links under /usr/lib/jvm-exports.

Note the links under /var/lib/tomcat5/common/lib that currently point somewhere
other than /usr/share/java:

lrwxrwxrwx 1 root root 38 Apr 24 13:37 [jdbc-stdext].jar ->
/could/not/find/extension/for/this/jvm
lrwxrwxrwx 1 root root 44 Apr 11 14:19 jdbc-stdext.jar ->
/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre/lib/
lrwxrwxrwx 1 root root 38 Apr 24 13:37 [jndi].jar ->
/could/not/find/extension/for/this/jvm

Tom, the one non-broken link is pointing to
/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre/lib (I assume to jdbc-stdext.jar which
is rt.jar---maybe this got cut off in the paste?). This is not the currently set
alternative for java. So am I correct in saying that to properly support
changing JAVA_HOME you would need:

(1) to make sure this same home is set as the java alternative at tomcat5
install-time
(2) that this java alternative must be a JPackage-compatible JDK in order to
provide the correct JVM exports

Again, I think that the missing JVM exports are are always harmless in practice
and that non-missing exports might actually break a situation like this where
JAVA_HOME is not set to the alternative used at build-jar-repository call-time
since I don't think it's possible to refresh that build-jar-repository at runtime.


Comment 9 Marcelo Giles 2008-04-25 19:14:12 UTC
I suggested customer to uninstall java-1.6.0-sun (if it is, as we suspect,
Sun's) and yum install Red Hat's java-1.6.0-sun pkg from RHN. 

Comment 10 David Knox 2010-10-20 17:24:53 UTC
These noted jars and tomcat5 package has been upgraded. This bug is no longer relevant.