4 Replies Latest reply on Jan 13, 2010 6:18 AM by sv kap

    migration from RF 3.3.2 to RF 3.3.3 and jsf 2

    sv kap Newbie

      Hi all.

       

      I want to migrate my current code to jsf 2. Here is what I have done:

       

      1. Replace jsf 1.2 libs with mojarra-2.0.2-FCS-binary.zip (implementation of  jsf 2)

      2. Replace richfaces-* version 3.3.2 with richfaces-* version 3.3.3 BETA 1

      3. edit my faces-config.xml:

       

      <faces-config version="2.0"
          xmlns="http://java.sun.com/xml/ns/javaee"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_2_0.xsd">
      ....

      ....

      </faces-config>

       

      4. Commented all managed bean declarations in faces-config and add annotations to bean classes (@ManagedBean and where necessary scope annotation. From what I have read the default scope is Request so annotations are added only where I want a different scope)

       

      5. Added to web.xml

       

          <context-param>
              <param-name>javax.faces.DISABLE_FACELET_JSF_VIEWHANDLER</param-name>
              <param-value>true</param-value>
          </context-param>

       

      I am using facelets and all my other libraries from the old and working project.

       

       

      I am getting this exception:

       

      SEVERE: Exception starting filter richfaces
      javax.servlet.ServletException: Error parse web application config
          at org.ajax4jsf.config.WebXMLParser.init(WebXMLParser.java:218)
          at org.ajax4jsf.webapp.WebXml.init(WebXml.java:111)
          at org.ajax4jsf.resource.InternetResourceService.init(InternetResourceService.java:130)
          at org.ajax4jsf.webapp.BaseFilter.init(BaseFilter.java:172)
          at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:275)
          at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:397)
          at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:108)
          at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:3800)
          at org.apache.catalina.core.StandardContext.start(StandardContext.java:4450)
          at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
          at org.apache.catalina.core.StandardHost.start(StandardHost.java:722)
          at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
          at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
          at org.apache.catalina.core.StandardService.start(StandardService.java:516)
          at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
          at org.apache.catalina.startup.Catalina.start(Catalina.java:583)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
          at java.lang.reflect.Method.invoke(Method.java:597)
          at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
          at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
      Caused by: org.ajax4jsf.config.ParsingException: No filter mapping set for a filter richfaces
          at org.ajax4jsf.config.WebXMLParser.init(WebXMLParser.java:148)
          at org.ajax4jsf.config.WebXMLParser.init(WebXMLParser.java:216)
          ... 21 more
      2010-1-12 11:11:07 org.apache.catalina.core.StandardContext start
      SEVERE: Error filterStart

        • 1. Re: migration from RF 3.3.2 to RF 3.3.3 and jsf 2
          Ilya Shaikovsky Master

          from exception:

          No filter mapping set for a filter richfaces

           

          check please web.xml on that.

           

          Also make sure you included only one impl jar. (richfaces-impl-jsf2) and not both ones.

          • 2. Re: migration from RF 3.3.2 to RF 3.3.3 and jsf 2
            sv kap Newbie

            web.xml was the first thing I checked. It looks ok (after all it was not changed from the previous working version).

             

            <context-param>
                    <param-name>org.ajax4jsf.VIEW_HANDLERS</param-name>
                    <param-value>com.sun.facelets.FaceletViewHandler</param-value>
                </context-param>
                <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>
                <listener>
                    <listener-class>com.sun.faces.config.ConfigureListener</listener-class>
                </listener>

             

             

            I saw that I have both jsf-api.jar, jsf-impl.jar (jsf 2) and richfaces-impl-jsf2-3.3.3.BETA1.jar. When I delete jsf-api.jar and jsf-impl.jar I get:

             

            SEVERE: Error configuring application listener of class com.sun.faces.config.ConfigureListener
            java.lang.ClassNotFoundException: com.sun.faces.config.ConfigureListener
                at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1387)

             

            What class should I use?

            • 3. Re: migration from RF 3.3.2 to RF 3.3.3 and jsf 2
              Ilya Shaikovsky Master
              Also make sure you included only one impl jar. (richfaces-impl-jsf2) and not both ones.

              I didn't meant that you have to remove any jsf jars. just meant you should bnot include both richfaces-impl-3.3.3 and richfaces-impl-3.3.3-jsf2 jars but the only second one while using jsf2

              • 4. Re: migration from RF 3.3.2 to RF 3.3.3 and jsf 2
                sv kap Newbie

                Ok. My mistake. I removed the richfaces-impl-3.3.3 and left only richfaces-impl-3.3.3-jsf2 but the result is the same as before:

                 

                SEVERE: Exception starting filter richfaces
                javax.servlet.ServletException: Error parse web application config
                    at org.ajax4jsf.config.WebXMLParser.init(WebXMLParser.java:218)
                    at org.ajax4jsf.webapp.WebXml.init(WebXml.java:111)
                    at org.ajax4jsf.resource.InternetResourceService.init(InternetResourceService.java:130)
                    at org.ajax4jsf.webapp.BaseFilter.init(BaseFilter.java:172)
                    at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:275)
                    at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:397)
                    at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:108)
                    at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:3800)
                    at org.apache.catalina.core.StandardContext.start(StandardContext.java:4450)
                    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
                    at org.apache.catalina.core.StandardHost.start(StandardHost.java:722)
                    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
                    at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
                    at org.apache.catalina.core.StandardService.start(StandardService.java:516)
                    at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
                    at org.apache.catalina.startup.Catalina.start(Catalina.java:583)
                    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                    at java.lang.reflect.Method.invoke(Method.java:597)
                    at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
                    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
                Caused by: org.ajax4jsf.config.ParsingException: No filter mapping set for a filter richfaces
                    at org.ajax4jsf.config.WebXMLParser.init(WebXMLParser.java:148)
                    at org.ajax4jsf.config.WebXMLParser.init(WebXMLParser.java:216)
                    ... 21 more
                2010-1-13 13:14:41 org.apache.catalina.core.StandardContext start
                SEVERE: Error filterStart