本文介绍了Tomcat(7,8)无法以java.lang.ClassNotFoundException开头:org.apache.tomcat.util.res.StringManager的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将Apache Tomcat安装到OS X El Capitan。我按照说明进行操作,基本上要求下载,解压缩并运行启动脚本。但是,当我输入localhost或localhost:8080时,主页无法打开。我检查并将Tomcat配置为端口8080.我检查了端口是否忙于命令 sudo lsof -i:8080 这表明没有使用。此外,我检查了 catalina.out 并找到了这条日志消息:

I am trying to install Apache Tomcat to OS X El Capitan. I followed these instructions, that basically ask to download, unpack and run start script. However, when I enter localhost or localhost:8080, home page does not open. I checked and Tomcat is configured to port 8080. I checked if the port is busy wit command sudo lsof -i :8080 which shows that is not being used. Further, I checked catalina.outand found this log message:

java.lang.NoClassDefFoundError: org/apache/tomcat/util/res/StringManager
    at org.apache.catalina.startup.Catalina.<clinit>(Catalina.java:74)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
    at java.lang.Class.newInstance(Class.java:442)
    at org.apache.catalina.startup.Bootstrap.init(Bootstrap.java:268)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:455)
Caused by: java.lang.ClassNotFoundException: org.apache.tomcat.util.res.StringManager
    at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    ... 8 more

我试图在线搜索例外,但找不到任何内容。

I tried to search for the Exception online, but could not find anything.

我也尝试下载Tomcat的新副本(7和8),但仍然抛出相同的异常。

I also tried to download fresh copy of Tomcat (7 and 8) but still same Exception is thrown.

希望有人可以帮我找到解决方案。
谢谢。

Hope someone can help me to find solution for this.Thank you.

推荐答案

您的{CATALINA_HOME} / lib文件夹中是否有tomcat-util.jar?如果存在,则tomcat类路径必定存在问题。

Do you have the tomcat-util.jar in your {CATALINA_HOME}/lib folder? If that is present then there must be an issue with your tomcat classpath.

这篇关于Tomcat(7,8)无法以java.lang.ClassNotFoundException开头:org.apache.tomcat.util.res.StringManager的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-04 23:55