6 Replies Latest reply on Nov 17, 2008 6:12 AM by tong tong

    how to config richfaces with existing apache myfaces project

    tong tong Newbie

      I already read the user guide, it only said


      There are some problems with different filters defined in the web.xml file clashing. To avoid these problems, the RichFaces filter must be the first one among other filters in the web.xml configuration file.

      For more information look at: http://myfaces.apache.org


      but the website http://myfaces.apache.org said nothing about how to configure myfaces with richfaces, so what should I do? should I copy richfaces-api-3.2.1.GA.jar, richfaces-impl-3.2.1.GA.jar to my project lib folder and let it coexists with myfaces-api-1.2.5.jar, myfaces-impl-1.2.5.jar
      ?

        • 1. Re: how to config richfaces with existing apache myfaces pro
          Nick Belaevski Master

          Yes, copy them as should be (do not forget to add richfaces-ui.jar). If you use extension filters you should configure filters chain so that RichFaces filter is the first one.

          • 2. Re: how to config richfaces with existing apache myfaces pro
            tong tong Newbie

            I have extension filter, the setting is
            <filter-mapping>
            <filter-name>extensionsFilter</filter-name>
            <servlet-name>Faces Servlet</servlet-name>
            </filter-mapping>

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

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

            how to configure filters chain so that RichFaces filter is the first one?

            • 3. Re: how to config richfaces with existing apache myfaces pro
              tong tong Newbie

              is this correct? put richfaces filter before extensionsFilter in web.xml?
              the physical ordering in web.xml is important, is this all I need?

              <filter-mapping>
              <filter-name>richfaces</filter-name>
              <servlet-name>Faces Servlet</servlet-name>
              REQUEST
              FORWARD
              INCLUDE
              </filter-mapping>
              <filter-mapping>
              <filter-name>extensionsFilter</filter-name>
              <servlet-name>Faces Servlet</servlet-name>
              </filter-mapping>

              • 4. Re: how to config richfaces with existing apache myfaces pro
                tong tong Newbie

                OH!! Exception occur after adding MyFaces jar!!

                java.lang.NoSuchMethodError: javax.faces.context.FacesContext.getELContext()Ljavax/el/ELContext;
                 at org.richfaces.skin.SkinFactoryImpl.processProperties(SkinFactoryImpl.java:261)
                 at org.richfaces.skin.SkinFactoryImpl.buildSkin(SkinFactoryImpl.java:301)
                 at org.richfaces.skin.SkinFactoryImpl.getSkinByName(SkinFactoryImpl.java:126)
                 at org.richfaces.skin.SkinFactoryImpl.getSkin(SkinFactoryImpl.java:141)
                 at org.ajax4jsf.event.AjaxPhaseListener.beforePhase(AjaxPhaseListener.java:119)
                 at org.apache.myfaces.lifecycle.PhaseListenerManager.informPhaseListenersBefore(PhaseListenerManager.java:73)
                 at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:140)
                 at javax.faces.webapp.FacesServlet.service(FacesServlet.java:147)
                 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
                 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                 at org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:301)
                 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
                 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                 at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:154)
                 at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:260)
                 at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:366)
                 at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:493)
                 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
                 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                 at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
                 at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
                 at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
                 at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
                 at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
                 at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
                 at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)
                 at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
                 at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
                 at java.lang.Thread.run(Thread.java:619)
                




                • 5. Re: how to config richfaces with existing apache myfaces pro
                  Ilya Shaikovsky Master

                   


                  is this correct? put richfaces filter before extensionsFilter in web.xml?
                  the physical ordering in web.xml is important, is this all I need?


                  yes.. the order is important,. And your definition is ok.

                  About the exception - please write which server you've using and libraries included in application.

                  • 6. Re: how to config richfaces with existing apache myfaces pro
                    tong tong Newbie

                    I known the reason now. I have mix up different version of MyFaces jar in the lib folder.
                    thanks for your help.