Apache Tomcat 8 不工作。抛出 HTTP 状态 500 - java.lang.ClassNotFoundException: org.apache.jsp.index_jsp
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/22730854/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Apache Tomcat 8 not working. Throws HTTP Status 500 - java.lang.ClassNotFoundException: org.apache.jsp.index_jsp
提问by Temp O'rary
I am using Apache Tomcat 8 and I've JDK 1.7.
我使用的是 Apache Tomcat 8,我使用的是 JDK 1.7。
Tomcat starts running after I run "startup.bat". But when I try to run "http://localhost:8080/
", it shows an error: "HTTP Status 500 - java.lang.ClassNotFoundException: org.apache.jsp.index_jsp"
运行“startup.bat”后,Tomcat 开始运行。但是当我尝试运行“ http://localhost:8080/
”时,它显示一个错误:“ HTTP Status 500 - java.lang.ClassNotFoundException: org.apache.jsp.index_jsp”
Please help me to fix this.
Click here to see the screenshot
请帮我解决这个问题。
单击此处查看屏幕截图
采纳答案by Temp O'rary
IT'S WORKING!
它正在工作!
What I did:
我做了什么:
- Opened command prompt using "Run as administrator"
Went to the "bin" directory of Tomcat folder.
cd C:\Program Files\apache-tomcat-8.0.3\bin'
- Entered 'startup' to run 'startup.bat' and the server started
- Opened a web browser entered
http://localhost:8080/
and it worked like charm. This also started generating Tomcat log files too.
- 使用“以管理员身份运行”打开命令提示符
转到Tomcat文件夹的“bin”目录。
cd C:\Program Files\apache-tomcat-8.0.3\bin'
- 输入“startup”运行“startup.bat”,服务器启动
- 打开输入的网络浏览器
http://localhost:8080/
,它的工作就像魅力一样。这也开始生成 Tomcat 日志文件。
The only different thing I performed is "Run as administrator".
我执行的唯一不同的是“以管理员身份运行”。
But I checked with Tomcat7 it did not require me to "Run as administrator" but it worked; not sure why
但是我检查了 Tomcat7 它不需要我“以管理员身份运行”但它有效;不知道为什么
回答by Justin Paul Pa?o
Check the lib folder of your tomcat installation. It must contain the JARs jasper-el.jar, jasper.jar, and jsp-api.jar. If they exist, maybe you should add Tomcat 8 in the Java Build Path for your project.
检查您的 tomcat 安装的 lib 文件夹。它必须包含 JAR jasper-el.jar、jasper.jar 和 jsp-api.jar。如果它们存在,也许您应该在项目的 Java 构建路径中添加 Tomcat 8。
EDIT:
编辑:
What you can do is to run shutdown.bat. Then look for a file called catalina.outin the logs folder of your tomcat installation. Open it in a text editor, delete all of its contents and save. Then try running startup.bat again. Next copy the contents of catalina.outand paste them here. This may help other people solve your problem.
你可以做的是运行shutdown.bat。然后在您的 tomcat 安装的日志文件夹中查找名为catalina.out的文件。在文本编辑器中打开它,删除其所有内容并保存。然后再次尝试运行 startup.bat。接下来复制catalina.out的内容并将它们粘贴到此处。这可能会帮助其他人解决您的问题。
回答by Justin Paul Pa?o
Simple, A ClassNotFoundException throws when some where a class that is used in the code is missing.
很简单,当代码中使用的类丢失时,会抛出 ClassNotFoundException。
EG : If it is for servlet, then it means something servlet api that is regularly available to tomcat is now missing for some reason.
EG:如果它是用于 servlet,那么这意味着由于某种原因,tomcat 经常可用的 servlet api 现在丢失了。
quite possibly the servlet-api.jar file in tomcat's lib folder (maybe other jar files in the tomcat lib folder) have become corrupted or removed.
很可能 tomcat 的 lib 文件夹中的 servlet-api.jar 文件(可能是 tomcat lib 文件夹中的其他 jar 文件)已损坏或删除。
Find it, you'll fix that.
找到它,你会解决它。