AnsweredAssumed Answered

getOutputStream() has already been called for this response

Question asked by edgar on Jul 31, 2007
Latest reply on Oct 20, 2008 by samuel.penn
Hi,

I have a 404 error page defined in my Web Project's web.xml:


<error-page>
      <error-code>404</error-code>
      <location>/service/404.jsp</location>
</error-page>

When I request a non-existing page in the Virtualization Server I get Tomcat's default 404 page (not my 404 page) and I see the following error in the Alfresco log file:


Jul 31, 2007 10:04:25 PM org.apache.catalina.core.StandardHostValve custom
SEVERE: Exception Processing ErrorPage[errorCode=404, location=/service/404.jsp]                                  
org.apache.jasper.JasperException: getOutputStream() has already been called for this response                               at
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:476)                        at
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:383)                                   at
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:315)                                          at
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)                                                 at
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)                                                      at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)                 at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)                         at
org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:691)                             at
org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:471)                     at
org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:403)                          at
org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:301)                            at
org.apache.catalina.core.StandardHostValve.custom(StandardHostValve.java:364)                                     at
org.apache.catalina.core.StandardHostValve.status(StandardHostValve.java:285)                                     at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)                                     at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)                                     at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)                                 at
org.alfresco.catalina.valve.AVMUrlValve.invoke(AVMUrlValve.java:375)                                              at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151)                                       at
org.alfresco.catalina.valve.AVMUrlValve.invoke(AVMUrlValve.java:718)                                     

It seems that the Alfresco Virtualization Server sits between Tomcat and the virtual web app and wants to be in charge of the response and does not expect that the web app wants to write out the response?

I see similar behavior for my custom Spring-based form (not an Alfresco Web Form).

Any ideas on how to avoid this?

regards,

Edgar

Outcomes