Apache Tomcat 8 not working. Throws HTTP Status 500 - java.lang.ClassNotFoundException: org.apache.jsp.index_jsp

倾然丶 夕夏残阳落幕 提交于 2021-02-07 02:58:42

问题


I am using Apache Tomcat 8 and I've 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"

Please help me to fix this. enter image description here Click here to see the screenshot


回答1:


IT'S WORKING!

What I did:

  1. Opened command prompt using "Run as administrator"
  2. Went to the "bin" directory of Tomcat folder.

    cd C:\Program Files\apache-tomcat-8.0.3\bin'  
    
  3. Entered 'startup' to run 'startup.bat' and the server started
  4. Opened a web browser entered http://localhost:8080/ and it worked like charm. This also started generating Tomcat log files too.

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




回答2:


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.

EDIT:

What you can do is to run shutdown.bat. Then look for a file called catalina.out in 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.out and paste them here. This may help other people solve your problem.




回答3:


I had the very same error attempting to reach the manager URL (actually, 404 then 500 after page refresh, each single time). I thought it was <SERVER_BASE_URL>/manager/. It turns out it was <SERVER_BASE_URL>/manager/html.

It’s worth mentioning it wouldn’t tell me I wasn’t using the right credentials either.




回答4:


Simple, A ClassNotFoundException throws when some where a class that is used in the code is missing.

EG : If it is for servlet, then it means something servlet api that is regularly available to tomcat is now missing for some reason.

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.

Find it, you'll fix that.



来源:https://stackoverflow.com/questions/22730854/apache-tomcat-8-not-working-throws-http-status-500-java-lang-classnotfoundexc

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!