https://issues.apache.org/bugzilla/show_bug.cgi?id=49022

           Summary: JSP Container Class Loader :Unable to load class for
                    JSP
           Product: Tomcat 6
           Version: 6.0.24
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Jasper
        AssignedTo: dev@tomcat.apache.org
        ReportedBy: qu-chungu...@necsoft.com.cn


Created an attachment (id=25210)
 --> (https://issues.apache.org/bugzilla/attachment.cgi?id=25210)
test jsp file

==Research version==
  Tomcat 6.0.24
==Also test version==
  Tomcat 5.5.23 have the same problem

==Steps to reproduce==
(100% reproduce)
1 create a simple test jsp page and publish to tomcat,
  webapps/gnizr/login.jsp
2 explorer the page at,
  http://localhost:8080/gnizr/login.jsp
  page displays ok.
3 restart tomcat
4 delete the work folder of this page,
  $ rm -rf work/Catalina/localhost/gnizr
  NOTE 1: delete the entire folder, not only the following java/class files,
    work/Catalina/localhost/gnizr/org/apache/jsp/login_jsp.java
    work/Catalina/localhost/gnizr/org/apache/jsp/login_jsp.class
  NOTE 2: DO NOT explorer the page before this step
5 explorer the page at,
  http://localhost:8080/gnizr/login.jsp
  and tomcat returns JasperException to explorer like that:

--
HTTP Status 500 -

type Exception report

message

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

exception

org.apache.jasper.JasperException: org.apache.jasper.JasperException: Unable to
load class for JSP
   
org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:156)
   
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:329)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

root cause

org.apache.jasper.JasperException: Unable to load class for JSP
   
org.apache.jasper.JspCompilationContext.load(JspCompilationContext.java:623)
   
org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:144)
   
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:329)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

root cause

java.lang.ClassNotFoundException: org.apache.jsp.login_jsp
    java.net.URLClassLoader$1.run(URLClassLoader.java:202)
    java.security.AccessController.doPrivileged(Native Method)
    java.net.URLClassLoader.findClass(URLClassLoader.java:190)
    org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:134)
    org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:66)
   
org.apache.jasper.JspCompilationContext.load(JspCompilationContext.java:621)
   
org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:144)
   
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:329)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

note The full stack trace of the root cause is available in the Apache
Tomcat/6.0.24 logs.
--

==Code Research==
After debug tomcat, we found that exception throws at:
JspCompilationContext.java line 621:
  servletClass = jspLoader.loadClass(name);
and before that, tomcat has successfully recompiled the jsp page at work
folder,
but it seems tomcat cannot find it when load it to memory.
we checked the object "ctxt", the data is right,
is it cause by JSP Container Class Loader's search path setting at startup?

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to