« Return to Thread: Unable to redirect to the error page when any exception occurs (500 internal server error)

Unable to redirect to the error page when any exception occurs (500 internal server error)

by sri_hari :: Rate this Message:

Reply to Author | View in Thread

Hi All,

When the system throws PropertyNotFoundException or any other FacesException, unable to redirect to the error page.  Instead of the error page url, system is taking the path of css file as the URI.

web.xml

<!-- Error pages -->
    <error-page>
        <error-code>404</error-code>
        <location>/error/ErrorPage.jsp</location>
    </error-page>
    <error-page>
        <error-code>500</error-code>
        <location>/error/ErrorPage.jsp</location>
    </error-page>
    <error-page>
        <exception-type>java.lang.Throwable</exception-type>
        <location>/error/ErrorPage.jsp</location>
    </error-page>

Error log:

Apr 23, 2009 7:43:23 PM org.apache.myfaces.trinidadinternal.application.StateManagerImpl restoreView
SEVERE: No structure available and no root available
Apr 23, 2009 7:43:24 PM com.sun.facelets.FaceletViewHandler handleRenderException
SEVERE: Error Rendering View[/jsp/managedeathrecord/BasicInfo.xhtml]
javax.faces.el.PropertyNotFoundException: /jsp/managedeathrecord/BasicInfo.xhtml @256,58 value="#{basicInfo.lastName3}": Error getting property 'lastName3' from bean of type com.mrc.web.managedeathrecord.BasicInfo
        at com.sun.facelets.el.LegacyValueBinding.getValue(LegacyValueBinding.java:58)
        at javax.faces.component.UIOutput.getValue(UIOutput.java:167)
        at com.sun.faces.renderkit.html_basic.HtmlBasicInputRenderer.getValue(HtmlBasicInputRenderer.java:102)
        at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.getCurrentValue(HtmlBasicRenderer.java:221)
        at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.encodeEnd(HtmlBasicRenderer.java:199)
        at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:740)
        at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.encodeRecursive(HtmlBasicRenderer.java:473)
        at com.sun.faces.renderkit.html_basic.GridRenderer.encodeChildren(GridRenderer.java:253)
        at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:721)
        at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.encodeRecursive(HtmlBasicRenderer.java:465)
        at com.sun.faces.renderkit.html_basic.GridRenderer.encodeChildren(GridRenderer.java:253)
        at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:721)
        at com.sun.facelets.tag.jsf.ComponentSupport.encodeRecursive(ComponentSupport.java:244)
        at com.sun.facelets.tag.jsf.ComponentSupport.encodeRecursive(ComponentSupport.java:249)
        at com.sun.facelets.tag.jsf.ComponentSupport.encodeRecursive(ComponentSupport.java:249)
        at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:594)
        at org.apache.myfaces.trinidadinternal.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:182)
        at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:107)
        at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:245)
        at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:137)
        at javax.faces.webapp.FacesServlet.service(FacesServlet.java:214)
        at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:713)
        at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:370)
        at com.evermind.server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:871)
        at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:453)
        at com.evermind.server.http.HttpRequestHandler.serveOneRequest(HttpRequestHandler.java:221)
        at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:122)
        at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:111)
        at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)
        at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
        at java.lang.Thread.run(Thread.java:595)
Apr 23, 2009 7:43:24 PM org.apache.myfaces.trinidadinternal.application.StateManagerImpl restoreView
SEVERE: No structure available and no root available
 2009-04-23 19:43:24,323 INFO  - Entering ErrorPage.jsp
 2009-04-23 19:43:24,323 INFO  - Request Url.... /error/ErrorPage.jsp
 2009-04-23 19:43:24,323 INFO  - pageContext.... com.evermind.server.http.EvermindPageContext@da2a84
 2009-04-23 19:43:24,323 INFO  - Context.... /mrc-web
 2009-04-23 19:43:24,323 INFO  - pageContext....error data javax.servlet.jsp.ErrorData@5adfca
 2009-04-23 19:43:24,323 INFO  - pageContext....error code 404
 2009-04-23 19:43:24,323 INFO  - pageContext....exception null
 2009-04-23 19:43:24,323 INFO  - Request Url.... /error/ErrorPage.jsp
 2009-04-23 19:43:24,323 INFO  - Exception.... null
 2009-04-23 19:43:24,323 INFO  - Error caught on ErrorPage.jsp..... null
 2009-04-23 19:43:24,323 INFO  - The error code is 404
 2009-04-23 19:43:24,339 INFO  - Entering ErrorPage.jsp
 2009-04-23 19:43:24,339 INFO  - Request Url.... /faces/jsp/css/jdeveloper.css
 2009-04-23 19:43:24,339 INFO  - pageContext.... com.evermind.server.http.EvermindPageContext@da2a84
 2009-04-23 19:43:24,339 INFO  - Context.... /mrc-web
 2009-04-23 19:43:24,339 INFO  - Entering ErrorPage.jsp
 2009-04-23 19:43:24,339 INFO  - Request Url.... /faces/jsp/css/jdeveloper.css
 2009-04-23 19:43:24,339 INFO  - pageContext.... com.evermind.server.http.EvermindPageContext@da2a84
 2009-04-23 19:43:24,339 INFO  - Context.... /mrc-web
 2009-04-23 19:43:24,339 INFO  - Entering ErrorPage.jsp
 2009-04-23 19:43:24,339 INFO  - Request Url.... /faces/jsp/css/jdeveloper.css
 2009-04-23 19:43:24,339 INFO  - pageContext.... com.evermind.server.http.EvermindPageContext@da2a84
 2009-04-23 19:43:24,339 INFO  - Context.... /mrc-web
 2009-04-23 19:43:24,339 INFO  - Entering ErrorPage.jsp
 2009-04-23 19:43:24,339 INFO  - Request Url.... /faces/jsp/css/jdeveloper.css
 2009-04-23 19:43:24,339 INFO  - pageContext.... com.evermind.server.http.EvermindPageContext@da2a84
 2009-04-23 19:43:24,339 INFO  - Context.... /mrc-web
 2009-04-23 19:43:24,339 INFO  - Entering ErrorPage.jsp
 2009-04-23 19:43:24,339 INFO  - Request Url.... /faces/jsp/css/jdeveloper.css
 2009-04-23 19:43:24,339 INFO  - pageContext.... com.evermind.server.http.EvermindPageContext@da2a84
 2009-04-23 19:43:24,339 INFO  - Context.... /mrc-web
 2009-04-23 19:43:24,339 INFO  - Entering ErrorPage.jsp
 2009-04-23 19:43:24,339 INFO  - Request Url.... /faces/jsp/css/jdeveloper.css
 2009-04-23 19:43:24,339 INFO  - pageContext.... com.evermind.server.http.EvermindPageContext@da2a84
 2009-04-23 19:43:24,339 INFO  - Context.... /mrc-web
 2009-04-23 19:43:24,339 INFO  - Entering ErrorPage.jsp
 2009-04-23 19:43:24,339 INFO  - Request Url.... /faces/jsp/css/jdeveloper.css
 2009-04-23 19:43:24,339 INFO  - pageContext.... com.evermind.server.http.EvermindPageContext@da2a84
 2009-04-23 19:43:24,339 INFO  - Context.... /mrc-web
 2009-04-23 19:43:24,339 INFO  - Entering ErrorPage.jsp
 2009-04-23 19:43:24,339 INFO  - Request Url.... /faces/jsp/css/jdeveloper.css
 2009-04-23 19:43:24,339 INFO  - pageContext.... com.evermind.server.http.EvermindPageContext@da2a84
 2009-04-23 19:43:24,339 INFO  - Context.... /mrc-web
Apr 23, 2009 7:43:24 PM org.apache.myfaces.trinidadinternal.application.StateManagerImpl restoreView
SEVERE: No structure available and no root available
 2009-04-23 19:43:24,355 INFO  - Entering ErrorPage.jsp
 2009-04-23 19:43:24,355 INFO  - Request Url.... /faces/jsp/managedeathrecord/BasicInfo.xhtml
 2009-04-23 19:43:24,355 INFO  - pageContext.... com.evermind.server.http.EvermindPageContext@da2a84
 2009-04-23 19:43:24,355 INFO  - Context.... /mrc-web
 2009-04-23 19:43:24,355 INFO  - Entering ErrorPage.jsp
 2009-04-23 19:43:24,355 INFO  - Request Url.... /faces/jsp/managedeathrecord/BasicInfo.xhtml
 2009-04-23 19:43:24,355 INFO  - pageContext.... com.evermind.server.http.EvermindPageContext@da2a84
 2009-04-23 19:43:24,355 INFO  - Context.... /mrc-web
 2009-04-23 19:43:24,355 INFO  - Entering ErrorPage.jsp
 2009-04-23 19:43:24,355 INFO  - Request Url.... /faces/jsp/managedeathrecord/BasicInfo.xhtml
 2009-04-23 19:43:24,355 INFO  - pageContext.... com.evermind.server.http.EvermindPageContext@da2a84
 2009-04-23 19:43:24,355 INFO  - Context.... /mrc-web
 2009-04-23 19:43:24,355 INFO  - Entering ErrorPage.jsp
 2009-04-23 19:43:24,355 INFO  - Request Url.... /faces/jsp/managedeathrecord/BasicInfo.xhtml
 2009-04-23 19:43:24,355 INFO  - pageContext.... com.evermind.server.http.EvermindPageContext@da2a84
 2009-04-23 19:43:24,355 INFO  - Context.... /mrc-web
 2009-04-23 19:43:24,355 INFO  - Entering ErrorPage.jsp
 2009-04-23 19:43:24,355 INFO  - Request Url.... /faces/jsp/managedeathrecord/BasicInfo.xhtml
 2009-04-23 19:43:24,355 INFO  - pageContext.... com.evermind.server.http.EvermindPageContext@da2a84
 2009-04-23 19:43:24,355 INFO  - Context.... /mrc-web
 2009-04-23 19:43:24,355 INFO  - Entering ErrorPage.jsp
 2009-04-23 19:43:24,355 INFO  - Request Url.... /faces/jsp/managedeathrecord/BasicInfo.xhtml
 2009-04-23 19:43:24,355 INFO  - pageContext.... com.evermind.server.http.EvermindPageContext@da2a84
 2009-04-23 19:43:24,355 INFO  - Context.... /mrc-web
 2009-04-23 19:43:24,355 INFO  - Entering ErrorPage.jsp
 2009-04-23 19:43:24,355 INFO  - Request Url.... /faces/jsp/managedeathrecord/BasicInfo.xhtml
 2009-04-23 19:43:24,355 INFO  - pageContext.... com.evermind.server.http.EvermindPageContext@da2a84
 2009-04-23 19:43:24,355 INFO  - Context.... /mrc-web
 2009-04-23 19:43:24,370 INFO  - Entering ErrorPage.jsp
 2009-04-23 19:43:24,370 INFO  - Request Url.... /faces/jsp/managedeathrecord/BasicInfo.xhtml
 2009-04-23 19:43:24,370 INFO  - pageContext.... com.evermind.server.http.EvermindPageContext@da2a84
 2009-04-23 19:43:24,370 INFO  - Context.... /mrc-web

Any ideas?

Thanks
- Srihari

 « Return to Thread: Unable to redirect to the error page when any exception occurs (500 internal server error)