tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 40104] New: - Jasper picking up incorrect file in JspServletWrapper.java context dump
Date Mon, 24 Jul 2006 17:09:27 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=40104>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=40104

           Summary: Jasper picking up incorrect file in
                    JspServletWrapper.java context dump
           Product: Tomcat 5
           Version: 5.5.17
          Platform: Other
        OS/Version: other
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Jasper
        AssignedTo: tomcat-dev@jakarta.apache.org
        ReportedBy: darryl@darrylmiles.org


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.

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

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


Mime
View raw message