在 Mac OS 10.6 上安装 tomcat 时出错
我一直在尝试在 Mac OS 10.6 上安装 tomcat-6.0.26。我按照以下说明进行操作:
1)从 此处
2) 将其解压到 /usr/local
3) sudo vi /etc/profile
并添加以下内容设置
export JAVA_HOME=/Library/Java/Home
export CATALINA_HOME=/usr/local/tomcat
4)sudo chown -R无人:nobody /usr/local/tomcat
5)cd /usr/local/tomcat/bin
和 sudo -u无人/ usr/local/tomcat/bin/startup.sh
然后给出以下输出。
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) 但是当我将浏览器指向 http://localhost:8080
时,它不会显示起始页。
7)当我sudo -u无人/usr/local/tomcat/bin/shutdown.sh
时,它抛出
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)我在这里做错了什么吗?任何帮助表示赞赏。
谢谢,
迪帕克。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
尝试删除环境变量,将所有文件设置为您自己(chown)并以您自己的方式运行它。这对我有用,但当然这还没有准备好生产。我仅将其用于开发目的。
你的启动应该是这样的:
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:
请访问此处并按照教程“在 Mac OS X Leopard 上安装 Apache Tomcat 6”。
Please visit here and follow the tutorial, Installing Apache Tomcat 6 on Mac OS X Leopard.
@Revil,@Lalith-我终于修好了。问题是,我之前在系统上安装了不同版本的 Tomcat,然后 $CATALINA_HOME/lib 中的所有 jar 都已复制到 /Library/Java/Extensions 中。由于我现在下载的版本与以前的版本不同,因此某种冲突导致一遍又一遍地出现相同的错误。当我从 /Library/Java/Extensions 中删除这些 jar 时,我能够再次启动并运行 Tomcat。
我在此页面上找到了解决方案 http://wiki.apache.org/tomcat/FAQ/Class_Not_Found
无论如何,感谢您的帮助。
迪帕克.
@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.