myfaces-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michal Borowiecki (JIRA)" <...@myfaces.apache.org>
Subject [jira] Created: (MYFACES-1346) exception when using a custom error page and a 404 occurs with an address that matches pattern for FasesServlet
Date Thu, 29 Jun 2006 11:02:30 GMT
exception when using a custom error page and a 404 occurs with an address that matches pattern
for FasesServlet
---------------------------------------------------------------------------------------------------------------

         Key: MYFACES-1346
         URL: http://issues.apache.org/jira/browse/MYFACES-1346
     Project: MyFaces Core
        Type: Bug

    Versions: 1.1.3, 1.1.1    
 Environment: JBoss-3.2.7
    Reporter: Michal Borowiecki


I have defined a custom error page and mapped it (among others) to 404 errors in web.xml:
<error-page>
		<error-code>400</error-code>
		<location>/error.jspx</location>
	</error-page>

It works for all addresses except those that match the mapping for the FacesServlet (*.jsf).
When a page that doesn't exist is requested, a standard Tomcat error page is shown instead
of the custom error page and the following exception is logged:

2006-06-29 12:50:32,655 ERROR TP-Processor6 [Engine] ApplicationDispatcher[] Servlet.service()
for servlet jsp threw exception
java.lang.IllegalStateException: getOutputStream() has already been called for this response
        at org.apache.coyote.tomcat5.CoyoteResponse.getWriter(CoyoteResponse.java:600)
        at org.apache.coyote.tomcat5.CoyoteResponseFacade.getWriter(CoyoteResponseFacade.java:164)
        at org.apache.jasper.runtime.JspWriterImpl.initOut(JspWriterImpl.java:124)
        at org.apache.jasper.runtime.JspWriterImpl.flushBuffer(JspWriterImpl.java:117)
        at org.apache.jasper.runtime.PageContextImpl.release(PageContextImpl.java:191)
        at org.apache.jasper.runtime.JspFactoryImpl.internalReleasePageContext(JspFactoryImpl.java:115)
        at org.apache.jasper.runtime.JspFactoryImpl.releasePageContext(JspFactoryImpl.java:75)
        at org.apache.jsp.error_jspx._jspService(error_jspx.java:185)
        at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
        at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
        at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
        at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
        at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:696)
        at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:476)
        at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:409)
        at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:312)
        at org.apache.catalina.core.StandardHostValve.custom(StandardHostValve.java:396)
        at org.apache.catalina.core.StandardHostValve.status(StandardHostValve.java:301)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:147)
        at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118)
        at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
        at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:535)
        at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
        at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
        at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
        at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
        at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
        at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
        at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:300)
        at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:374)
        at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:743)
        at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:675)
        at org.apache.jk.common.SocketConnection.runIt(ChannelSocket.java:866)
        at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
        at java.lang.Thread.run(Thread.java:534)
2006-06-29 12:50:32,657 ERROR TP-Processor6 [Engine] org.apache.catalina.core.StandardHostValve@77c8d6:
Exception Processing ErrorPage[errorCode=404, location=/error.jspx]
java.lang.IllegalStateException: getOutputStream() has already been called for this response
        at org.apache.coyote.tomcat5.CoyoteResponse.getWriter(CoyoteResponse.java:600)
        at org.apache.coyote.tomcat5.CoyoteResponseFacade.getWriter(CoyoteResponseFacade.java:164)
        at org.apache.jasper.runtime.JspWriterImpl.initOut(JspWriterImpl.java:124)
        at org.apache.jasper.runtime.JspWriterImpl.flushBuffer(JspWriterImpl.java:117)
        at org.apache.jasper.runtime.PageContextImpl.release(PageContextImpl.java:191)
        at org.apache.jasper.runtime.JspFactoryImpl.internalReleasePageContext(JspFactoryImpl.java:115)
        at org.apache.jasper.runtime.JspFactoryImpl.releasePageContext(JspFactoryImpl.java:75)
        at org.apache.jsp.error_jspx._jspService(error_jspx.java:185)
        at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
        at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
        at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
        at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
        at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:696)
        at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:476)
        at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:409)
        at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:312)
        at org.apache.catalina.core.StandardHostValve.custom(StandardHostValve.java:396)
        at org.apache.catalina.core.StandardHostValve.status(StandardHostValve.java:301)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:147)
        at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118)
        at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
        at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:535)
        at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
        at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
        at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
        at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
        at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
        at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
        at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:300)
        at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:374)
        at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:743)
        at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:675)
        at org.apache.jk.common.SocketConnection.runIt(ChannelSocket.java:866)
        at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
        at java.lang.Thread.run(Thread.java:534)

Apparently Tomcat cannot get the writer from the response object, because getOutputStream()
has already been called on it.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


Mime
View raw message