title: Are Richfaces and Primefaces compatible with each other?
body: <p>I am using Primefaces-2.1 now, I try to integrate Richfaces-3.3.3 in my application in order to use <code>&lt;rich:jQuery&gt;</code>. My <code>&lt;p:commandButton&gt;</code>, <code>&lt;p:commandLink&gt;</code> stop working as soon as I integrate the Richfaces, I give me this exception: Any idea why?</p>
  
  <pre><code>Exception in the filter chain
  javax.servlet.ServletException: Index: 0, Size: 0
  at javax.faces.webapp.FacesServlet.service(FacesServlet.java:325)
  at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1523)
  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:343)
  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:215)
  at com.scholar.filter.MyFilter.doFilter(MyFilter.java:36)
  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256)
  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:215)
  at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:206)
  at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)
  at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:388)
  at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:515)
  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256)
  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:215)
  at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:277)
  at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:188)
  at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:641)
  at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:97)
  at com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:85)
  at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:185)
  at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:325)
  at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:226)
  at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:165)
  at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:791)
  at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:693)
  at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:954)
  at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:170)
  at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:135)
  at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:102)
  at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:88)
  at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:76)
  at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:53)
  at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:57)
  at com.sun.grizzly.ContextTask.run(ContextTask.java:69)
  at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:330)
  at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:309)
  at java.lang.Thread.run(Thread.java:637)
  
  Caused by: java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
  at java.util.ArrayList.RangeCheck(ArrayList.java:547)
  at java.util.ArrayList.get(ArrayList.java:322)
  at javax.faces.component.AttachedObjectListHolder.restoreState(AttachedObjectListHolder.java:161)
  at javax.faces.component.UIComponentBase.restoreState(UIComponentBase.java:1427)
  at javax.faces.component.UIComponentBase.processRestoreState(UIComponentBase.java:1202)
  at javax.faces.component.UIComponentBase.processRestoreState(UIComponentBase.java:1217)
  at javax.faces.component.UIComponentBase.processRestoreState(UIComponentBase.java:1217)
  at javax.faces.component.UIComponentBase.processRestoreState(UIComponentBase.java:1217)
  at javax.faces.component.UIViewRoot.processRestoreState(UIViewRoot.java:865)
  at org.ajax4jsf.component.AjaxViewRoot.processRestoreState(AjaxViewRoot.java:761)
  at org.ajax4jsf.application.AjaxStateManager.restoreView(AjaxStateManager.java:456)
  at com.sun.faces.application.view.ViewHandlingStrategy.restoreView(ViewHandlingStrategy.java:131)
  at com.sun.faces.application.view.FaceletViewHandlingStrategy.restoreView(FaceletViewHandlingStrategy.java:430)
  at com.sun.faces.application.view.MultiViewHandler.restoreView(MultiViewHandler.java:143)
  at javax.faces.application.ViewHandlerWrapper.restoreView(ViewHandlerWrapper.java:288)
  at org.ajax4jsf.application.ViewHandlerWrapper.restoreView(ViewHandlerWrapper.java:107)
  at com.sun.faces.lifecycle.RestoreViewPhase.execute(RestoreViewPhase.java:199)
  at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
  at com.sun.faces.lifecycle.RestoreViewPhase.doPhase(RestoreViewPhase.java:110)
  at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
  at javax.faces.webapp.FacesServlet.service(FacesServlet.java:312)
  </code></pre>
  
  <p>Here is my <code>web.xml</code></p>
  
  <pre><code>&lt;servlet&gt;
      &lt;servlet-name&gt;Faces Servlet&lt;/servlet-name&gt;
      &lt;servlet-class&gt;javax.faces.webapp.FacesServlet&lt;/servlet-class&gt;
      &lt;load-on-startup&gt;1&lt;/load-on-startup&gt;
  &lt;/servlet&gt;
  &lt;servlet-mapping&gt;
      &lt;servlet-name&gt;Faces Servlet&lt;/servlet-name&gt;
      &lt;url-pattern&gt;*.jsf&lt;/url-pattern&gt;
  &lt;/servlet-mapping&gt;
  &lt;filter&gt;
      &lt;display-name&gt;RichFaces Filter&lt;/display-name&gt;
      &lt;filter-name&gt;richfaces&lt;/filter-name&gt;
      &lt;filter-class&gt;org.ajax4jsf.Filter&lt;/filter-class&gt;
  &lt;/filter&gt;
  
  &lt;filter-mapping&gt;
      &lt;filter-name&gt;richfaces&lt;/filter-name&gt;
      &lt;servlet-name&gt;Faces Servlet&lt;/servlet-name&gt;
      &lt;dispatcher&gt;REQUEST&lt;/dispatcher&gt;
      &lt;dispatcher&gt;FORWARD&lt;/dispatcher&gt;
      &lt;dispatcher&gt;INCLUDE&lt;/dispatcher&gt;
  &lt;/filter-mapping&gt;
  </code></pre>
  
  <p>And here is all the library I include:<br>
  Primefaces-2.1<br>
  Richfaces-3.3.3<br>
  Commons-Logging-1.1.1<br>
  Commons-Digester-2.0<br>
  Commons-Beanutils-1.8.3<br>
  JHighlight-1.0</p>