All,

On 6/2/21 13:52, Christopher Schultz wrote:
All,

I don't do too much work with JSPs, but I do have a few quick-and-dirty administrative things including one called the "session snooper" which just dumps out loads of information about the current user's session object.

I'm getting this error in production, and I can reproduce it every time I access the page. Here's the exception stack trace:

java.lang.ClassNotFoundException: org.apache.jsp.admin.SessionSnooper_jsp
java.net.URLClassLoader.findClass(URLClassLoader.java:382)
   at org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:128)    at org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:59)    at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:159)    at org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:192)    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:413)    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:382)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:330)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:733)
    [...filters, etc...]

This is a relatively simple JSP. There are no tag libraries in use and there are 3 imports of JSPs which contain some static utility functions.

Both files app/work/Catalina/localhost/[$context]/org/apache/jsp/admin/SessionSnooper_jsp.java and app/work/Catalina/localhost/[$context]/org/apache/jsp/admin/SessionSnooper_jsp.java exist and have file-dates from way back in 2016. (No recent changes)

The context has been restarted/reloaded (not redeployed) recently using JMX a few times, but nothing else relevant comes to mind.

This is Tomcat 8.5.65 from a stock ASF-distrubuted tarball, launched using "catalina.sh start". Nothing fancy.

What other information can I collect to help debug this? My expectation would be that the class should be findable and runnable. Tomcat should not be tripping over its own feet on this one IMO.

There is more in my catalina.out file:

Jun 02, 2021 4:12:27 PM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet [jsp] in context with path [/[$context]] threw exception [java.lang.NullPointerException] with root cause
java.lang.NullPointerException
at org.apache.jasper.JspCompilationContext.createOutputDir(JspCompilationContext.java:685) at org.apache.jasper.JspCompilationContext.getOutputDir(JspCompilationContext.java:204) at org.apache.jasper.JspCompilationContext.getClassFileName(JspCompilationContext.java:537) at org.apache.jasper.compiler.Compiler.isOutDated(Compiler.java:464) at org.apache.jasper.compiler.Compiler.isOutDated(Compiler.java:430) at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:590) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:399) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:382) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:330)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:733)

Here's the code from createOutputDir:


l684        File base = options.getScratchDir();
l685        baseUrl = base.toURI().toURL();
l686        outputDir = base.getAbsolutePath() + File.separator + path +
l687                File.separator;
l688        if (!makeOutputDir()) {
l689 throw new IllegalStateException(Localizer.getMessage("jsp.error.outputfolder"));
l690        }

I'm not playing any games with JSP configuration or scratch/work directory locations, etc.

-chris

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

Reply via email to