Bug 29258 - Tomcat 5.0.24+ jmx.jar may not be in CLASSPATH
Summary: Tomcat 5.0.24+ jmx.jar may not be in CLASSPATH
Alias: None
Product: Tomcat 5
Classification: Unclassified
Component: Catalina (show other bugs)
Version: 5.0.24
Hardware: Sun Solaris
: P3 minor with 1 vote (vote)
Target Milestone: ---
Assignee: Tomcat Developers Mailing List
Depends on:
Reported: 2004-05-27 21:09 UTC by Chris Cheyney (SmartTrust)
Modified: 2004-11-16 19:05 UTC (History)
0 users


Note You need to log in before you can comment on or make changes to this bug.
Description Chris Cheyney (SmartTrust) 2004-05-27 21:09:08 UTC
When you upgrade an existing Tomcat 5.0.19 server to Tomcat 5.0.24+,
you may have problems getting the server to come up without adding
jmx.jar explicitly to the CLASSPATH.  This happens only after a
badly applied upgrade.

The "fix" to make sure this doesn't happen is to add jmx.jar to the
CLASSPATH after commons-logging-api.jar.  Without this fix, you may see
this message in catalina.out:

  Bootstrap: Class loader creation threw exception
  java.lang.NoClassDefFoundError: javax/management/MBeanServerFactory
          at org.apache.catalina.startup.Bootstrap.createClassLoader
          at org.apache.catalina.startup.Bootstrap.initClassLoaders
          at org.apache.catalina.startup.Bootstrap.init(Bootstrap.java:193)
          at org.apache.catalina.startup.Bootstrap.init(Bootstrap.java:270)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke
          at sun.reflect.DelegatingMethodAccessorImpl.invoke
          at java.lang.reflect.Method.invoke(Method.java:324)
          at org.apache.commons.daemon.support.DaemonLoader.load

Since you can fix the configuration problem in the server, adding
jmx.jar explicitly to the CLASSPATH is a minor bug fix, although
it might provide a big hint to people who are upgrading Tomcat
5.0.19 servers.

Typically this error means someone may have moved jmx.jar to its
previous resting place (i.e., $CATALINA_HOME/common/lib) because
they thought that's where it was supposed to go, so you can just
restore a correct copy of jmx.jar to bin to recover from this problem.

This could be avoided by a documentation update instead of a code
Comment 1 Yoav Shapira 2004-05-27 23:50:08 UTC
What documentation update would you suggest?
Comment 2 Rainer Jung 2004-05-28 08:28:10 UTC
I think originally this worked by having inside the manifest of bootstrap.jar
the line

Class-Path: jmx.jar commons-daemon.jar commons-logging-api.jar

and putting jmx.jar to the bin directory.
Comment 3 Yoav Shapira 2004-05-28 14:44:49 UTC
The manifest for bootstrap.jar has not changed: it still contains jmx.jar 
before commons-logging in the classpath line.  Also, jmx.jar is still in the 
bin directory, so that hasn't changed either.
Comment 4 Chris Cheyney (SmartTrust) 2004-05-28 15:36:08 UTC
I would update the change logs to add a more explicit comment about
jmx.jar residing in bin instead of common/lib.  Anything more than
that is probably overkill since you only get this problem when you
do something odd to the install (like moving the jmx.jar file into
common/lib again, etc.).

Adding jmx.jar to the startup scripts might help make it clear that
the startup has JMX dependencies.

Comment 5 Yoav Shapira 2004-05-28 15:45:03 UTC
It was already in the changelog (v5.0.20), but I don't think that's visible 
enough, so I've added the following to the RELEASE NOTES file, in the standard 
APIs section:

Please note that the JMX API is available to applications as well.  The jmx.jar
file used to be located in the common/lib directory, but was moved to the bin
directory as part of the Tomcat 5.0.20 release.  The jmx.jar is in Tomcat's
bootstrap classpath (included via the Class Path line in bootstrap.jar's 

This will of course be visible and available starting with the next release, 
Comment 6 Alan Tam 2004-07-16 16:22:59 UTC
I just downloaded 5.0.27 binary and it still occurs:
sltam@delta:~/jakarta-tomcat-5.0.27$ bin/catalina.sh run
Using CATALINA_BASE:   /home/sltam/jakarta-tomcat-5.0.27
Using CATALINA_HOME:   /home/sltam/jakarta-tomcat-5.0.27
Using CATALINA_TMPDIR: /home/sltam/jakarta-tomcat-5.0.27/temp
Using JAVA_HOME:       /usr/lib/kaffe
Due to new licensing guidelines mandated by the Apache Software
Foundation Board of Directors, a JMX implementation can no longer
be distributed with the Apache Tomcat binaries. As a result, you
must download a JMX 1.2 implementation (such as the Sun Reference
Implementation) and copy the JAR containing the API and
implementation of the JMX specification to:

JDK: kaffe 1.1.5 branch
System: Debian Linux unstable i686

Adding this to catalina.sh solves:
Comment 7 Yoav Shapira 2004-07-21 18:34:15 UTC
Tomcat requires a JDK that understands Jar Class Path directives, which your 
kaffe 1.1.5 apparently doesn't.  If your JDK doesn't understand these 
directives, you may have to manually modify a number of things, not just 
catalina.sh, as you undoubtedly know by now.