JSF2 and Richfaces 3.3.3 application on tomcat 6.0 crashes with a StackOverflowError

Posted by Vivek Madapura V on Stack Overflow See other posts from Stack Overflow or by Vivek Madapura V
Published on 2010-11-04T03:32:51Z Indexed on 2011/01/16 5:54 UTC
Read the original article Hit count: 457

Filed under:
|
|

Hi,

I am using JSF 2 and richfaces 3.3.3 for an application hosted on tomcat 6.0.20. The application crashes as soon as a request is made via the browser (Mozilla and IE).

My web.xml looks like this:

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
 xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
 id="WebApp_ID" version="2.5">

 <display-name>TestJSF</display-name>

 <welcome-file-list>
  <welcome-file>pages/login.xhtml</welcome-file>
 </welcome-file-list>

 <servlet>
  <servlet-name>Faces Servlet</servlet-name>
  <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
  <load-on-startup>1</load-on-startup>
 </servlet>

 <servlet-mapping>
  <servlet-name>Faces Servlet</servlet-name>
  <url-pattern>/faces/*</url-pattern>
 </servlet-mapping>
 <servlet-mapping>
  <servlet-name>Faces Servlet</servlet-name>
  <url-pattern>*.xhtml</url-pattern>
 </servlet-mapping>

 <context-param>
  <description>State saving method: 'client' or 'server' (=default). See JSF Specification 2.5.2</description>
  <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
  <param-value>server</param-value>
 </context-param>
 <context-param>
  <param-name>javax.faces.DISABLE_FACELET_JSF_VIEWHANDLER</param-name>
  <param-value>true</param-value>
 </context-param>
 <context-param>
  <param-name>org.richfaces.SKIN</param-name>
  <param-value>blueSky</param-value>
 </context-param>
 <context-param>
  <param-name>org.richfaces.CONTROL_SKINNING</param-name>
  <param-value>enable</param-value>
 </context-param>
 <context-param>
  <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
  <param-value>.xhtml</param-value>
 </context-param>
 <context-param>
  <param-name>javax.faces.FACELETS_SKIP_COMMENTS</param-name>
  <param-value>true</param-value>
 </context-param>

 <listener>
  <listener-class>com.sun.faces.config.ConfigureListener</listener-class>
 </listener>

 <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</servlet-name>
  <dispatcher>REQUEST</dispatcher>
  <dispatcher>FORWARD</dispatcher>
  <dispatcher>INCLUDE</dispatcher>
 </filter-mapping>

</web-app>

The exception is

    javax.servlet.ServletException: Servlet execution threw an exception
 org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:530)
 com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:542)
 com.sun.faces.application.view.JspViewHandlingStrategy.executePageToBuildView(JspViewHandlingStrategy.java:359)
 com.sun.faces.application.view.JspViewHandlingStrategy.buildView(JspViewHandlingStrategy.java:150)
 com.sun.faces.application.view.JspViewHandlingStrategy.renderView(JspViewHandlingStrategy.java:190)
 com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:127)
 org.ajax4jsf.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:100)
 org.ajax4jsf.application.AjaxViewHandler.renderView(AjaxViewHandler.java:176)
 com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:117)
 com.sun.faces.lifecycle.Phase.doPhase(Phase.java:97)
 com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:135)
 javax.faces.webapp.FacesServlet.service(FacesServlet.java:309)

The stack trace is recursively logged with this until the StackOverflowError occurrs.

If I remove all the configurations related to Richfaces, the application works like charm. Any advice is much appreciated.

© Stack Overflow or respective owner

Related posts about richfaces

Related posts about jsf-2.0