myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mike Kienenberger" <mkien...@gmail.com>
Subject Re: Problem occurred while serving the error page?
Date Fri, 31 Oct 2008 19:51:00 GMT
Sorry.  I'm not of much help on this yet.  The primary reason I
answered your message is that I had just updated the wiki page section
with a new link, and I had it handy.

I just added this to the "Using servlets" section, so maybe it answers
your question?

 === Using servlets ===
 Mert Caliskan (http://www.jroller.com/page/mert?entry=handling_errors_with_an_errror)
describes an approach which wraps the JSF servlet with a new servlet
which delegates to the faces servlet but handles uncaught exceptions
allowing the developer to redirect to a custom error page.
+
+ Andrea Paternesi has refined this technique for MyFaces as described here:
+ [http://patton-prog-tips.blogspot.com/2008/10/myfaces-handling-viewexpiredexception.html]



On Fri, Oct 31, 2008 at 3:41 PM, laredotornado <laredotornado@gmail.com> wrote:
>
> Yes, that's where I got the JSP and servlet (whose code I didn't include but
> it is in the link you sent) from.  But something with my error configuration
> isn't right.  But what?  Below is my web.xml if that is useful. - Dave
>
>
> ========================Begin web.xml =========================
> <?xml version="1.0"?>
> <web-app xmlns="http://java.sun.com/xml/ns/j2ee"
>         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>         xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
> http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
>         version="2.4">
>
>        <filter>
>                <filter-name>No Caching Filter</filter-name>
>                <filter-class>com.myco.npsconfig.filters.NoCachingFilter</filter-class>
>        </filter>
>
>
>        <filter>
>                <filter-name>SSOFilter</filter-name>
>                <filter-class>com.myco.nps.im.plugin.NPSIMIntercepter</filter-class>
>                <init-param>
>                        <param-name>filter_conf_file</param-name>
>
> <param-value>/export/third-party/etsbea/application_conf/wls_9.2.2/nps_config_gui_conf/nps_im_plugIn.properties</param-value>
>                </init-param>
>        </filter>
>
>        <filter-mapping>
>                <filter-name>No Caching Filter</filter-name>
>                <url-pattern>/*</url-pattern>
>        </filter-mapping>
>        <filter-mapping>
>            <filter-name>SSOFilter</filter-name>
>            <url-pattern>/*</url-pattern>
>        </filter-mapping>
>
>  <!-- Faces Servlet
>       Marty Hall: changed .jsf back to standard of .faces -->
>  <servlet>
>     <servlet-name>Faces Servlet</servlet-name>
>     <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
>     <load-on-startup>1</load-on-startup>
>  </servlet>
>  <servlet>
>     <servlet-name>Log4JServlet</servlet-name>
>     <servlet-class>com.myco.npsconfig.servlet.Log4JServlet</servlet-class>
>     <load-on-startup>1</load-on-startup>
>  </servlet>
>  <servlet>
>     <servlet-name>RefreshServlet</servlet-name>
>
> <servlet-class>com.myco.npsconfig.servlet.RefreshServlet</servlet-class>
>     <load-on-startup>2</load-on-startup>
>  </servlet>
>  <servlet>
>        <description>
>        </description>
>        <display-name>
>        LoginSuccessServlet</display-name>
>        <servlet-name>LoginSuccessServlet</servlet-name>
>        <servlet-class>
>        com.myco.npsconfig.jsf.controllers.LoginSuccessServlet</servlet-class>
>     <load-on-startup>1</load-on-startup>
>  </servlet>
>  <servlet-mapping>
>     <servlet-name>Faces Servlet</servlet-name>
>     <url-pattern>*.jsf</url-pattern>
>  </servlet-mapping>
>  <servlet-mapping>
>        <servlet-name>LoginSuccessServlet</servlet-name>
>        <url-pattern>/LoginSuccessServlet</url-pattern>
>  </servlet-mapping>
>  <servlet-mapping>
>        <servlet-name>Log4JServlet</servlet-name>
>        <url-pattern>/refresh</url-pattern>
>  </servlet-mapping>
>  <servlet-mapping>
>        <servlet-name>RefreshServlet</servlet-name>
>        <url-pattern>/RefreshServlet</url-pattern>
>  </servlet-mapping>
>
>   <filter>
>        <filter-name>MyFacesExtensionsFilter</filter-name>
>
> <filter-class>org.apache.myfaces.webapp.filter.ExtensionsFilter</filter-class>
>    <init-param>
>        <param-name>maxFileSize</param-name>
>        <param-value>20m</param-value>
>    </init-param>
>        </filter>
> <!-- extension mapping for adding <script/>, <link/>, and other resource
> tags to JSF-pages  -->
> <filter-mapping>
>    <filter-name>MyFacesExtensionsFilter</filter-name>
>    <!-- servlet-name must match the name of your
> javax.faces.webapp.FacesServlet entry -->
>    <servlet-name>Faces Servlet</servlet-name>
> </filter-mapping>
>
> <!-- extension mapping for serving page-independent resources (javascript,
> stylesheets, images, etc.)  -->
> <filter-mapping>
>    <filter-name>MyFacesExtensionsFilter</filter-name>
>    <url-pattern>/faces/myFacesExtensionResource/*</url-pattern>
> </filter-mapping>
>
> <filter-mapping>
>    <filter-name>MyFacesExtensionsFilter</filter-name>
>    <url-pattern>*.jsf</url-pattern>
> </filter-mapping>
>
>        <error-page>
>                <error-code>500</error-code>
>                <location>/jsp/ErrorDisplay.jsf</location>
>        </error-page>
>
> </web-app>
> =========================End web.xml==========================
>
>
>
> Mike Kienenberger wrote:
>>
>> Have you read through the documentation at the following location?
>>
>> http://wiki.apache.org/myfaces/Handling_Server_Errors
>>
>> On Fri, Oct 31, 2008 at 2:51 PM, laredotornado <laredotornado@gmail.com>
>> wrote:
>>>
>>> Hi,
>>>
>>> I'm using MyFaces 1.1.6 on WebLogic 9.2.2.  My app is throwing an error,
>>> but
>>> my error page is not displaying.  The errorPage is generating this error
>>> ...
>>>
>>> ####<Oct 31, 2008 12:47:33 PM MDT> <Error> <HTTP> <rhonti>
>>> <nps-supp-gui-ms-1> <[ACTIVE] ExecuteThread: '5' for queue:
>>> 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <>
<>
>>> <1225478853990> <BEA-101107>
>>> <[weblogic.servlet.internal.WebAppServletContext@1c931fb - appName:
>>> 'nps_config_gui', name: 'nps_config_gui.war', context-path:
>>> '/nps_config_gui'] Problem occurred while serving the error page.
>>> java.lang.IllegalStateException: parent is null?
>>>        at
>>> javax.faces.webapp.UIComponentTag.findComponent(UIComponentTag.java:545)
>>>        at
>>> javax.faces.webapp.UIComponentTag.doStartTag(UIComponentTag.java:315)
>>>        at
>>> jsp_servlet._jsp.__errordisplay._jsp__tag0(__errordisplay.java:134)
>>>        at
>>> jsp_servlet._jsp.__errordisplay._jspService(__errordisplay.java:110)
>>>        at weblogic.servlet.jsp.JspBase.service(JspBase.java:34)
>>>        at
>>> weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
>>>        at
>>> weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
>>>        at
>>> weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:283)
>>>        at
>>> weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:175)
>>>        at
>>> weblogic.servlet.internal.RequestDispatcherImpl.invokeServlet(RequestDispatcherImpl.java:525)
>>>        at
>>> weblogic.servlet.internal.RequestDispatcherImpl.forward(RequestDispatcherImpl.java:261)
>>>        at
>>> org.apache.myfaces.context.servlet.ServletExternalContextImpl.dispatch(ServletExternalContextImpl.java:419)
>>>        at
>>> org.apache.myfaces.application.jsp.JspViewHandlerImpl.renderView(JspViewHandlerImpl.java:211)
>>>        at
>>> org.ajax4jsf.framework.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:108)
>>>        at
>>> org.ajax4jsf.framework.ajax.AjaxViewHandler.renderView(AjaxViewHandler.java:233)
>>>        at
>>> org.apache.myfaces.lifecycle.RenderResponseExecutor.execute(RenderResponseExecutor.java:41)
>>>        at
>>> org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:132)
>>>        at javax.faces.webapp.FacesServlet.service(FacesServlet.java:140)
>>>        at
>>> weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
>>>        at
>>> weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
>>>        at
>>> weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:283)
>>>        at
>>> weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:175)
>>>        at
>>> weblogic.servlet.internal.RequestDispatcherImpl.invokeServlet(RequestDispatcherImpl.java:525)
>>>        at
>>> weblogic.servlet.internal.RequestDispatcherImpl.forward(RequestDispatcherImpl.java:261)
>>>        at
>>> weblogic.servlet.internal.ServletResponseImpl.sendError(ServletResponseImpl.java:706)
>>>        at
>>> weblogic.servlet.internal.ServletResponseImpl.sendError(ServletResponseImpl.java:555)
>>>        at
>>> weblogic.servlet.internal.ErrorManager.handleException(ErrorManager.java:203)
>>>        at
>>> weblogic.servlet.internal.WebAppServletContext.handleThrowableFromInvocation(WebAppServletContext.java:2062)
>>>        at
>>> weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:1915)
>>>        at
>>> weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1362)
>>>        at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
>>>        at weblogic.work.ExecuteThread.run(ExecuteThread.java:181)
>>>
>>>
>>> And here is my error JSP page.  Know what's going on?  Thanks, - Dave
>>>
>>> =================Begin errorDisplay.jsp =========================
>>> <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
>>> <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
>>> <%@ taglib uri="http://myfaces.apache.org/tomahawk" prefix="t"%>
>>> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
>>> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
>>> <f:subview id="error"
>>>    xmlns:f="http://java.sun.com/jsf/core"
>>>    xmlns:t="http://myfaces.apache.org/tomahawk"
>>>    xmlns:h="http://java.sun.com/jsf/html">
>>>
>>> <html>
>>> <head>
>>>        <meta content="no-cache" http-equiv="Cache-Control" />
>>>        <meta content="no-cache" http-equiv="Pragma" />
>>>        <title>NPS Config GUI - Error</title>
>>>        </head>
>>>        <body>
>>>        <h:form>
>>>           <h:outputText styleClass="infoMessage" escape="false"
>>> value="#{ErrorDisplay.infoMessage}" />
>>>           <t:htmlTag value="br" />
>>>           <h:inputTextarea style="width: 99%;" rows="10" readonly="true"
>>> value="#{ErrorDisplay.stackTrace}" />
>>>        </h:form>
>>>    </body>
>>> </html>
>>> </f:subview>
>>> ==================End errorDisplay.jsp =========================
>>> --
>>> View this message in context:
>>> http://www.nabble.com/Problem-occurred-while-serving-the-error-page--tp20272097p20272097.html
>>> Sent from the MyFaces - Users mailing list archive at Nabble.com.
>>>
>>>
>>
>>
>
> --
> View this message in context: http://www.nabble.com/Problem-occurred-while-serving-the-error-page--tp20272097p20272906.html
> Sent from the MyFaces - Users mailing list archive at Nabble.com.
>
>

Mime
View raw message