Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

problem displaying error page of web.xml when using JSF, Ajax4jsf

843844Apr 2 2008
Hi,

My application is using MyFaces, RichFaces and Ajax4jsf. When i try to display error page configured in web.xml, i am getting exception "Error while processing error page".

my web.xml contents are as follows:

<?xml version="1.0"?>

<web-app version="2.4" 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">
....
....

<filter>
<display-name>RichFaces Filter</display-name>
<filter-name>richfaces</filter-name>
<filter-class>org.ajax4jsf.Filter</filter-class>
</filter>
<filter-mapping>
<filter-name>richfaces</filter-name>
<servlet-name>faces</servlet-name>
<dispatcher>REQUEST</dispatcher>
<dispatcher>FORWARD</dispatcher>
<dispatcher>INCLUDE</dispatcher>
</filter-mapping>
<filter>
<filter-name>extensionsFilter</filter-name>
<filter-class>
org.apache.myfaces.webapp.filter.ExtensionsFilter
</filter-class>
<init-param>
<description>
set the size limit for uploaded files. Format: 10 - 10 bytes 10k
- 10 KB 10m - 10 MB 1g - 1 GB
</description>
<param-name>uploadMaxFileSize</param-name>
<param-value>100m</param-value>
</init-param>
<init-param>
<description>
Set the threshold size - files below this limit are stored in
memory, files above this limit are stored on disk.
Format: 10 - 10 bytes 10k - 10 KB 10m - 10 MB 1g - 1 GB
</description>
<param-name>uploadThresholdSize</param-name>
<param-value>100k</param-value>
</init-param>
</filter>
<filter>
<filter-name>Seam Redirect Filter</filter-name>
<filter-class>org.jboss.seam.servlet.SeamRedirectFilter</filter-class>
</filter>

<filter>
<filter-name>KTServletFilter</filter-name>
<filter-class>com.kenexa.core.system.KTServletFilter</filter-class>
</filter>

<filter-mapping>
<filter-name>extensionsFilter</filter-name>
<url-pattern>*.jsf</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>extensionsFilter</filter-name>
<url-pattern>/faces/*</url-pattern>
</filter-mapping>

<filter-mapping>
<filter-name>Seam Redirect Filter</filter-name>
<url-pattern>*.jsf</url-pattern>
</filter-mapping>

<filter-mapping>
<filter-name>KTServletFilter</filter-name>
<url-pattern>*.jsf</url-pattern>
</filter-mapping>

<!-- seam Listeners -->
<listener>
<listener-class>org.jboss.seam.servlet.SeamListener</listener-class>
</listener>
<listener>
<listener-class>com.kenexa.kr.web.KRServletListener</listener-class>
</listener>

<servlet>
<servlet-name>faces</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>faces</servlet-name>
<url-pattern>*.jsf</url-pattern>
</servlet-mapping>
<error-page>
<exception-type>java.lang.Throwable</exception-type>
<location>/rc/systemError.jsf</location>
</error-page>
</web-app>

As per the configuration, when exception is thrown out of the application, container tries to display systemError.jsp page. If we want to include the JSF tags in systemError.jsp page, the request should pass through FacesServlet, so in the <error-page> <location> tag systemError page is specified with the extention systemError.jsf though it's actual extention is .jsp

When exception is thrown from the application container invoke the error page but, while rendering systemError.jsf page exception is thrown saying "Exception processing error page "systemError.jsp" "

To solve this problem i've gone through several forums, materials.

In one forum a guy said, JSF1.1 spec has some problem in displaying error pages. To solve this don't write <f:view> tags in the error page, use <f:subview> intstead. By reading this, i again changed the contents of systemError.jsp page replacing <f:view> by <f:subview>. But the error is still repeating.

Finally what i found is, when we use Ajax4jsf in the application, its AjaxViewRender class is throwing exception while rendering error pages configured through web.xml.

So what i did is i changed error page extention from .jsf to .jsp in the <location> tag. Now jsf won't come in the picture and remove JSF related tags from the systemError.jsp page.

<error-page>
<exception-type>java.lang.Throwable</exception-type>
<location>/rc/systemError.jsp</location>
</error-page>

Any comments are welcome----------------------------------------------------------------
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 30 2008
Added on Apr 2 2008
0 comments
307 views