Tomcat 5.5 installation problems

1.8k views Asked by At

I was running Tomcat 5.5.23 on centOS 5.5 then had to reinstall for some reason. After installation it will not start. Checking the catalina.out file resulted in this error. Googling for a few hours showed the result was to copy the missing jar file into a directory (/var/lib/tomcat5/server/lib) which solved the problem but however created another one; this time I'm getting the following error:

Using CATALINA_BASE:   /usr/share/tomcat5
Using CATALINA_HOME:   /usr/share/tomcat5
Using CATALINA_TMPDIR: /usr/share/tomcat5/temp
Using JRE_HOME:       /usr/lib/jvm/java-1.6.0-openjdk-1.6.0.0.x86_64
java.lang.NoClassDefFoundError: org/apache/tomcat/util/log/SystemLogHandler
        at java.lang.Class.getDeclaredConstructors0(Native Method)
        at java.lang.Class.privateGetDeclaredConstructors(Class.java:2406)
        at java.lang.Class.getConstructor0(Class.java:2716)
        at java.lang.Class.newInstance0(Class.java:343)
        at java.lang.Class.newInstance(Class.java:325)
        at org.apache.catalina.startup.Bootstrap.init(Bootstrap.java:225)
        at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:410)
Caused by: java.lang.ClassNotFoundException: org.apache.tomcat.util.log.SystemLogHandler
        at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:319)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:264)
        at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:332)
        ... 7 more

I have been Googling for hours to no end and I suspect this isn't a "copying jar files into a directory problem" but rather a set environment variable problem, but the problem is that I'm not sure where to set said variable. Although there is no CLASSPATH variable defined for the system, (I believe this gets created in the startup script) but everything in the tomcat5.conf is set correctly. Any help would be appreciated. The closest similar issue I found was by this guy on the Tomcat mailing list but as you can see it's a few years old.

1

There are 1 answers

12
Alain Pannetier On BEST ANSWER

First thing to check is that you have tomcat-util jar under /usr/share/tomcat5/server/lib

I notice that you mention /var/lib/tomcat/server/lib whereas the catalina.out says CATALINA_HOME equates to /usr/share/tomcat5 which is way more standard.

You need to make sure that the server tree is correctly deployed under /usr/share/tomcat5 if this is what CATALINA_HOME is set to.

Did you install as RPM or just untaring the tarball` from the apache download site ?

DO you start tomcat with /usr/share/tomcat5/bin/startup.sh ? Or with a less standard procedure ?

In the end what you need is something like

java 
  -classpath /usr/share/tomcat5/bin/bootstrap.jar
  -Djava.endorsed.dirs=$JAVA_ENDORSED_DIRS
  -Dcatalina.base="$CATALINA_BASE"
  -Dcatalina.home="$CATALINA_HOME"
  -Djava.io.tmpdir="$CATALINA_TMPDIR"
   org.apache.catalina.startup.Bootstrap

And these variables might be defined in /etc/environment (assuming redhat/centos are not different in this than debian) or only a shell script wrapping startup.sh or catalina.sh