You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by BugRat Mail System <to...@cortexity.com> on 2000/09/07 15:36:34 UTC
BugRat Report #78 has been filed.
Bug report #78 has just been filed.
You can view the report at the following URL:
<http://znutar.cortexity.com:8888/BugRatViewer/ShowReport/78>
REPORT #78 Details.
Project: Tomcat
Category: Bug Report
SubCategory: New Bug Report
Class: swbug
State: received
Priority: high
Severity: critical
Confidence: public
Environment:
Release: Tomca 3.2B3
JVM Release: JDK 1.3
Operating System: Windows 2000
OS Release: Professional
Platform: Pentium III @600Mhz
Synopsis:
ErrorPage does not work when a jsp includes another jsp that throws an exception
Description:
I am trying to catch all errors from my JSP, but I have found a problem
with Jakarta-Tomcat that it is not on OrionServer.
I have two jsp: jsp1 and jsp2. jsp1 includes jsp2, and then jsp2 throws
an error. I am using tomcat 3.2B3 on windows 2000 with jdk 1.3.
I have tested the same with orionserver and it works fine. On this mail
I send the error thrown and the three jsp pages: jsp1.jsp, jsp2.jsp and
errorPage.jsp.
When I run http://localhost/mycontext/jsp1.jsp I get the following
error:
This is the content from jsp1 before inserting jsp2
--------------------------------------------------------------------------------
Included servlet error: 500
Localizacion:/isum/jsp1.jsp
Error interno del servlet:
java.lang.IllegalStateException: Cannot forward as OutputStream or
Writer has already been obtained
at
org.apache.tomcat.facade.RequestDispatcherImpl.forward(RequestDispatcherImpl.java:150)
at
org.apache.jasper.runtime.PageContextImpl.forward(PageContextImpl.java:414)
at
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:438)
at
_0002fjsp_00032_0002ejspjsp2_jsp_5._jspService(_0002fjsp_00032_0002ejspjsp2_jsp_5.java:70)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:119)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:177)
at
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:296)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:369)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:368)
at org.apache.tomcat.core.Handler.service(Handler.java:261)
at
org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:356)
at
org.apache.tomcat.facade.RequestDispatcherImpl.include(RequestDispatcherImpl.java:308)
at
org.apache.jasper.runtime.PageContextImpl.include(PageContextImpl.java:407)
at
_0002fjsp_00031_0002ejspjsp1_jsp_5._jspService(_0002fjsp_00031_0002ejspjsp1_jsp_5.java:69)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:119)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:177)
at
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:296)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:369)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:368)
at org.apache.tomcat.core.Handler.service(Handler.java:261)
at
org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:356)
at
org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:720)
at
org.apache.tomcat.core.ContextManager.service(ContextManager.java:666)
at
org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConnectionHandler.java:194)
at
org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:403)
at
org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:498)
at java.lang.Thread.run(Unknown Source)
--------------------------------------------------------------------------------
This is the content from jsp1 after inserting jsp2
---------- jsp1.jsp----------
<%@ page errorPage="/errorPage.jsp" %>
<html>
<head><title>JSP Page</title></head>
<body>
<%
out.println("This is the content from jsp1 before inserting jsp2");
%>
<hr>
<jsp:include page="jsp2.jsp" flush="true"/>
<hr>
<%
out.println("This is the content from jsp1 after inserting jsp2");
%>
</body>
</html>
------------------------------
---------- jsp2.jsp----------
<%@ page errorPage="errorPage.jsp" %>
<%
out.println("Lets throw an exception:.....");
if (true) throw new Exception("Oops an Error has occurred");
%>
------------------------------
---------- errorPage.jsp----------
<%@ page isErrorPage="true" import="java.io.*,com.tissat.isum.util.Util"
%>
<html>
<head><title>JSP Page</title></head>
<body>
Something bad has happened. And it looks like: <br>
<%= "Exception "+ exception %>
<br><br>
<%= "Message " + exception.getMessage() %>
<%
Util.error(exception.toString());
//exception.printStackTrace(); %>
<br>
</body>
</html>
--------------------------------------
How could this be solved? Has this already reported as a bug?