views:

57

answers:

3

Hi,

I have been trying to install tomcat-6.0.26 on my Mac OS 10.6. I followed these instructions:

1)Get the latest binary from here

2) Extract it to /usr/local

3) sudo vi /etc/profile and add the following settings

export JAVA_HOME=/Library/Java/Home
export CATALINA_HOME=/usr/local/tomcat

4)sudo chown -R nobody:nobody /usr/local/tomcat

5)cd /usr/local/tomcat/bin and sudo -u nobody /usr/local/tomcat/bin/startup.sh which then gives the following output.

Using CATALINA_BASE:   /usr/local/Tomcat
Using CATALINA_HOME:   /usr/local/Tomcat
Using CATALINA_TMPDIR: /usr/local/Tomcat/temp
Using JRE_HOME:        /Library/Java/Home
Using CLASSPATH:       /usr/local/Tomcat/bin/bootstrap.jar

6) But when I point my browser to http://localhost:8080, it won't show the start page.

7) And when I sudo -u nobody /usr/local/tomcat/bin/shutdown.sh, it throws

Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/juli/logging/LogFactory
    at org.apache.catalina.startup.Bootstrap.<clinit>(Bootstrap.java:55)
Caused by: java.lang.ClassNotFoundException: org.apache.juli.logging.LogFactory
    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 sun.misc.Launcher$ExtClassLoader.findClass(Launcher.java:229)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
    ... 1 more

8) Am I doing anything wrong here? Any help is appreciated.

Thanks,

Deepak.

A: 

Please visit here and follow the tutorial, Installing Apache Tomcat 6 on Mac OS X Leopard.

Lalith
@Lalith - I get the same error with those instructions too.
Deepak Konidena
+1  A: 

Try removing your environmental variables, setting all the files to yourself (chown) and run it as yourself. This works for me, but of course this is not production ready. I use this for development purposes only.

Your startup should look like this:

Using CATALINA_BASE:   /Users/username/location/apache-tomcat-6.0.26
Using CATALINA_HOME:   /Users/username/location/apache-tomcat-6.0.26
Using CATALINA_TMPDIR: /Users/username/location/apache-tomcat-6.0.26/temp
Using JRE_HOME:        /System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Home
Using CLASSPATH:       /Users/username/location/apache-tomcat-6.0.26/bin/bootstrap.jar
revil
@Revil - the same problem persists. I suspect it has to do something with the latest tomcat binary?
Deepak Konidena
I am using the same binary.make sure you are running the most up to date java for os x:http://support.apple.com/downloads/Java_for_Mac_OS_X_10_6_Update_2Also, if you chmod for your own account, you should probably move it under your /Users/username/ directory.When you made those changes, did your startup text change to something like I posted in my answer?
revil
A: 

@Revil, @Lalith- I finally fixed it. The problem was, I previously installed a different version of Tomcat on my System, and all the jars in $CATALINA_HOME/lib had been copied to /Library/Java/Extensions then. Since the version i downloaded now is different from the previous one, some kind of conflict had been resulting in the same error over and over again. When I deleted those jars from /Library/Java/Extensions, i was able to bring Tomcat up and running again.

I found the solution on this page http://wiki.apache.org/tomcat/FAQ/Class_Not_Found

Anyways, thanks for the help.

Deepak.

Deepak Konidena