Unable to load class for JSP

Source: Internet
Author: User
Error: Unable to load class for JSP!

Error: Unable to load class for JSP!

<1> start Tomcat 5.exe in C:/tomcat 5.5/bind.

<2> in C:/tomcat 5.5/CONF/server. XML,
Some code is added as follows:
<Context Path = "/MyApp" docbase = "C:/tomcat 5.5/webapps/MyApp" DEBUG = "0" reloadable = "true">
</Context>

<3> place the JSP source code in: C:/tomcat 5.5/webapps/MyApp.
C:/tomcat 5.5/webapps/MyApp/WEB-INF including: Directory classes and Lib, and Web. xml
The files in the Directory class have been compiled to generate the class file,
The content of web. XML is:
<? XML version = "1.0" encoding = "ISO-8859-1"?>
<! Doctype web-app
Public "-// Sun Microsystems, Inc. // DTD web application 2.3 // en"
Http://java.sun.com/dtd/web-app_2_3.dtd>
<Web-app>
<Display-Name> my web application </display-Name>
<Description>
A Application for test.
</Description>
</Web-app>

<4> enter http: // localhost: 8080/MyApp/index. jsp in the browser.
The result is displayed as follows:

Posting time: 17:11:31 Set to confidential!


Qngwycjhhm

Level:
Property:
Experience:
Charm:
Registration: 2006-03-30
Article: 2
Authentication: Confidential

 


Reply: an error occurs: Unable to load class for JSP!

HTTP status 500-

TypeException report

Message

Description The server encountered an internal error () that prevented it from fulfilling this request.

Exception

org.apache.jasper.JasperException: Unable to load class for JSP
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:510)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:375)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

Root Cause

org.apache.jasper.JasperException: Unable to load class for JSP
org.apache.jasper.JspCompilationContext.load(JspCompilationContext.java:598)
org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:147)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:315)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

Root Cause

java.lang.ClassNotFoundException: org.apache.jsp.index_jsp
java.net.URLClassLoader$1.run(Unknown Source)
java.security.AccessController.doPrivileged(Native Method)
java.net.URLClassLoader.findClass(Unknown Source)
org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:133)
org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:65)
org.apache.jasper.JspCompilationContext.load(JspCompilationContext.java:596)
org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:147)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:315)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

Note The full stack trace of the root cause is available in the Apache Tomcat/5.5.15 logs.

Apache Tomcat/5.5.15
Posting time: 17:21:12 Set to confidential!


Meimeier

Level:
Property:
Experience:
Charm:
Registration: 2006-04-18
Article: 6
Authentication: Confidential

 

OICQ
Reply: an error occurs: Unable to load class for JSP!
I have the same error. You can give me some guidance.

----------------------------------------------
West
Posting time: 13:38:46 Set to confidential!


Freestar

Level:
Property:
Experience:
Charm:
Registration: 2006-04-20
Article: 1
Authentication: Confidential

 

OICQ
Reply: an error occurs: Unable to load class for JSP!

This problem is that the custom class compilation file cannot be found. You can add the classes directory before the custom class file (. class. In this way, you can do it. It is best to define a package by yourself. Writing the package name won't cause such a problem.

----------------------------------------------
You will never fail unless you give up!
Posting time: 21:15:36 Set to confidential!


Slashliang

Level:
Property:
Experience:
Charm:
Registration: 2006-06 6
Article: 1
Authentication: Confidential

 



Thank you so much! I added a pack to solve the problem! You are so good! [Em01]

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.