Thursday, January 9, 2014

Tomcat 7 FindClass org/apache/catalina/startup/Bootstrap failed

Environment

  • Windows Server 2008 R2
  • Tomcat 7 x64
  • jdk1.7.0_45 x64

 Problem


After upgrading from Tomcat 6 to 7 the new Tomcat instance did not want to start up. This is what I saw in the logs:

[2014-01-09 19:08:46] [info]  [ 2516] Commons Daemon procrun (1.0.15.0 64-bit) started
[2014-01-09 19:08:46] [info]  [ 2516] Running 'Tomcat7' Service...
[2014-01-09 19:08:46] [info]  [ 6004] Starting service...
[2014-01-09 19:08:47] [error] [ 6080] FindClass org/apache/catalina/startup/Bootstrap failed
[2014-01-09 19:08:47] [error] [ 6004] Failed to start Java
[2014-01-09 19:08:47] [error] [ 6004] ServiceStart returned 4
[2014-01-09 19:08:47] [info]  [ 2516] Run service finished.
[2014-01-09 19:08:47] [info]  [ 2516] Commons Daemon procrun finished


2014-01-09 19:08:46 Commons Daemon procrun stderr initialized
java.lang.NoClassDefFoundError: org/apache/juli/logging/LogFactory
    at org.apache.catalina.startup.Bootstrap.(Bootstrap.java:60)
Caused by: java.lang.ClassNotFoundException: org.apache.juli.logging.LogFactory
    at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
    ... 1 more
Exception in thread "main" 


All I found on the net was that Java 5 is not compatible with Tomcat 7. But I had the latest Java 7.


Solution


With trial and error I found the solution:

I had to include tomcat-juli.jar also in the Java Classpath!

I opened an administrative Command Prompt and edited the Tomcat instance's Properties

D:\apps\tomcat7\bin> tomcat7w.exe //ES//Tomcat7




4 comments:

  1. hello there,

    i cant found tomcat7w.exe to edit on my tomcat 7.0.42
    how do i add tomcat-juli.jar also in the Java Classpath ?

    ReplyDelete
    Replies
    1. It has to be in the path where tomcat is installed. You are on windows, I guess?

      Delete
  2. Thanks !! this helped to solve the problem.

    ReplyDelete