tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeff Turner <j...@socialchange.net.au>
Subject Re: Tomcat - Error Handler
Date Wed, 22 Nov 2000 02:34:35 GMT
Hi,

I get the same exception when using the JSP error handler after a
<jsp:include>, eg:

---- index.jsp ----
<%@ page errorPage="error.jsp" %>
<jsp:include page="foo.html" flush="true"/>
<% if (true) throw new RuntimeException("An exception"); %>
-------------------

---- error.jsp ----
<%@ page isErrorPage="true" %>
Error page
------------------

(foo.html can be blank)

Now when I go to index.jsp, I get the following exception:

Error: 500

Location:/index.jsp

Internal Servlet Error:

java.lang.IllegalStateException: Cannot forward as OutputStream or Writer
has already been obtained
        at
org.apache.tomcat.facade.RequestDispatcherImpl.forward(RequestDispatcherImpl.java,
Compiled Code)
        at
org.apache.jasper.runtime.PageContextImpl.forward(PageContextImpl.java,
Compiled Code)
        at
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java,
Compiled Code)
        at
_0002findex_0002ejspindex_jsp_9._jspService(_0002findex_0002ejspindex_jsp_9.java,
Compiled Code)
        at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java,
Compiled Code)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java,
Compiled Code)
        at
org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java,
Compiled Code)
        at
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java,
Compiled Code)
        at org.apache.jasper.servlet.JspServlet.service(JspServlet.java,
Compiled Code)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java,
Compiled Code)
        at
org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java,
Compiled Code)
        at org.apache.tomcat.core.Handler.service(Handler.java, Compiled
Code)
        at
org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java,
Compiled Code)
        at
org.apache.tomcat.core.ContextManager.internalService(ContextManager.java,
Compiled Code)
        at
org.apache.tomcat.core.ContextManager.service(ContextManager.java,
Compiled Code)
        at
org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConnectionHandler.java,
Compiled Code)
        at
org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java,
Compiled Code)
        at
org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java,
Compiled Code)
        at java.lang.Thread.run(Thread.java, Compiled Code)


--Jeff


On Thu, 16 Nov 2000, Sumit Vohra wrote:

> Hi guys, 
> 
>   I have been trying to replace the JSDK web server backend with Tomcat,
> and I have a message brokering servlet which works fine on JSDK when
> applications connect to it. This servlet brokers both plain and multipart
> messages. Now, as I mentioned it works fine on JSDK, on Tomcat, only
> multipart messages are going through, plain messages are not. And, also
> when I try to connect the monitoring application for the servlet to the
> servlet, to get status information  it gives exceptions which it
> did not at all on JSDK web server. The exception on server is: 
> ==================================================================
> ERROR: can't find default error handler or error in default error page
> java.lang.IllegalStateException: Write is already being used for this
> request 
> at 
> org.apache.tomcat.core.ResponseImpl.getOutputStream(ResponseImpl.java:458)
> at 
> org.apache.tomcat.core.HttpServletResponseFacade.getOutputStream(HttpServl
> etResponseFacade.java:144)
>  :
>  :
> ====================================================================
> 
> Could anybody please tell me why this is happening and what is the
> difference in JSDK Web Server and Tomcat's message handling techniques
> regarding multipart and plain. 
> 
> I appreciate it. 
> Thanks in advance
> -sumit 
> 
> 					
> 			-Sumit Vohra (sumit143@cc.gatech.edu)
> 



Mime
View raw message