New tomcat install on OSX choking on startup-Collection of common programming errors

I’ve completed a fresh install of Tomcat6 on an OS X box that didn’t have it before. It’s behaved a bit strangely in other ways, but the current hang-up is that it won’t start at all. In response to running startup.sh, the catalina.out log collects this error:

Exception in thread "main" java.lang.NoClassDefFoundError:  org/apache/catalina/startup/Bootstrap
Caused by: java.lang.ClassNotFoundException: org.apache.catalina.startup.Bootstrap
        at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:248)

Other bits of strangeness noticed with this installation:

  • the .sh scripts in the bin directory had no execute permission, and had to be manually chmodded.
  • The log folder wasn’t created, causing an earlier script crash. After I manually created the log folder, the startup script made it to this new error before failing.
  • Running other scripts in the bin folder generates similar error messages involving NoClassDefFoundError.
  • Bootstrap.java is indeed in the right place, though Bootstrap.class isn’t in the same folder. For that matter, if any of the myriad class files for tomcat should have already been generated from their .java files, I haven’t seen it.
  1. what version of java are you running on your machine? from first look at this command i would say it looks like you could possibly be running java1.5 and this version of tomcat needs java1.6 seen this happening a couple of times.

  2. I never did find out what it was, but installing from precompiled binaries rather than ant building from scratch fixed it.