org.apache.jasper.JasperException: Exception in JSP: /WEB-INF/template/debug.jspf:4 1: <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" isErrorPage="true"%> 2: <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> 3: <%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> 4: <%@ taglib prefix="g" uri="http://domain.com/taglibs/generic-0.1" %> 5: <jsp:directive.page import="java.io.*"/> 6: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> 7: <html> Stacktrace: at org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:510) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:375) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264) at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) ...SNIP... The exception correctly reports the point of the error: /WEB-INF/template/debug.jspf:4 But the 7 lines of context are actually from the file /WEB-INF/template/errorpage.jsp jasper/jasper2/src/share/org/apache/jasper/servlet/JspServletWrapper.java:471 uses: // Read both files in, so we can inspect them String[] jspLines = readFile (this.ctxt.getResourceAsStream(this.ctxt.getJspFile())); String[] javaLines = readFile (new FileInputStream(this.ctxt.getServletJavaFileName())); Is that correctly picking up the context from the exception information ? The page debuig.jspf is added to a master page with: <%@ include file="/WEB-INF/template/debug.jspf" %> The exception looks like it created here: return new JasperException( "Exception in JSP: " + detail.getJspFileName() + ":" + jspLineNumber + "\n\n" + buffer + "\n\nStacktrace:", ex); That uses detail.getJspFileName() not this.ctxt.getServletJavaFileName(). I'm thinking both cases should use detail.getJspFileName(). I have ErrorPages setup to /WEB-INF/template/errorpage.jsp.
Opps not this.ctxt.getServletJavaFileName(). I meant to say I think this.ctxt.getJspFile() should be detail.getJspFileName() (or the equalvalent of)
This has been fixed in svn and will be included in 5.5.21 onwards.