在 Mac OS 10.6 上安装 tomcat 时出错

发布于 2024-09-07 11:11:21 字数 1732 浏览 5 评论 0原文

我一直在尝试在 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/binsudo -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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

简单 2024-09-14 11:11:21

尝试删除环境变量,将所有文件设置为您自己(chown)并以您自己的方式运行它。这对我有用,但当然这还没有准备好生产。我仅将其用于开发目的。

你的启动应该是这样的:

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

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
·深蓝 2024-09-14 11:11:21

请访问此处并按照教程“在 Mac OS X Leopard 上安装 Apache Tomcat 6”。

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

小耗子 2024-09-14 11:11:21

@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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文