0 Replies Latest reply on Aug 12, 2006 10:54 AM by Basel Al-Mustafa

    How can I get jsf error pages to work similar to the blog sa

    Basel Al-Mustafa Newbie

      In my case I get "Exception Processing ErrorPage" when I try to access a jsf page that does not exist such as doe.jsf.

      According to the following post on one of the mailing lists, having jsf/xhtml to handle error pages is not possible.
      http://mail-archives.apache.org/mod_mbox/myfaces-users/200606.mbox/%3Cbc36a6210606241518w1b3879advfa85c6b1955a911a@mail.gmail.com%3E

      However, this does not happen with the blog sample application. Also, the error page gets rendered without exceptions when I access a non-jsf page that does not exist such as asdoe.jsp, doe.other and doe.js. What could be the problem?

      16:25:07,854 ERROR [STDERR] Aug 12, 2006 4:25:07 PM com.sun.facelets.FaceletViewHandler handleRenderException
      SEVERE: Error Rendering View[/404.xhtml]
      java.lang.IllegalStateException: getOutputStream() has already been called for this response
       at org.apache.catalina.connector.Response.getWriter(Response.java:599)
       at org.apache.catalina.connector.ResponseFacade.getWriter(ResponseFacade.java:195)
       at com.sun.facelets.FaceletViewHandler.createResponseWriter(FaceletViewHandler.java:463)
       at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:537)
       at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:384)
       at javax.faces.webapp.FacesServlet.service(FacesServlet.java:138)
       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:672)
       at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:465)
       at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:398)
       at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:301)
       at org.apache.catalina.core.StandardHostValve.custom(StandardHostValve.java:363)
       at org.apache.catalina.core.StandardHostValve.status(StandardHostValve.java:284)
       at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:136)
       at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
       at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
       at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
       at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
       at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
       at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
       at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
       at java.lang.Thread.run(Thread.java:595)
      16:25:07,860 ERROR [[Faces Servlet]] Servlet.service() for servlet Faces Servlet threw exception
      java.lang.IllegalStateException: getOutputStream() has already been called for this response
       at org.apache.catalina.connector.Response.getWriter(Response.java:599)
       at org.apache.catalina.connector.ResponseFacade.getWriter(ResponseFacade.java:195)
       at com.sun.facelets.FaceletViewHandler.handleRenderException(FaceletViewHandler.java:639)
       at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:609)
       at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:384)
       at javax.faces.webapp.FacesServlet.service(FacesServlet.java:138)
       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:672)
       at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:465)
       at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:398)
       at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:301)
       at org.apache.catalina.core.StandardHostValve.custom(StandardHostValve.java:363)
       at org.apache.catalina.core.StandardHostValve.status(StandardHostValve.java:284)
       at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:136)
       at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
       at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
       at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
       at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
       at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
       at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
       at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
       at java.lang.Thread.run(Thread.java:595)
      16:25:07,862 ERROR [[localhost]] Exception Processing ErrorPage[errorCode=404, location=/404.jsf]
      javax.servlet.ServletException: getOutputStream() has already been called for this response
       at javax.faces.webapp.FacesServlet.service(FacesServlet.java:152)
       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:672)
       at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:465)
       at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:398)
       at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:301)
       at org.apache.catalina.core.StandardHostValve.custom(StandardHostValve.java:363)
       at org.apache.catalina.core.StandardHostValve.status(StandardHostValve.java:284)
       at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:136)
       at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
       at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
       at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
       at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
       at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
       at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
       at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
       at java.lang.Thread.run(Thread.java:595)