2 Replies Latest reply on May 24, 2013 6:06 AM by Himanshu Bhardwaj

    Moving from Richfaces 4.1.0.Final to 4.3.2.Final

    Himanshu Bhardwaj Newbie

      Hi All,

       

      Recently I was trying to upgrade my application from RF-4.1.0.Final to RF-4.3.2.Final.

       

      Application Server I am using is Tomcat-7 and the project is built using Maven.

       

      Few issues that I had faced:

       

      1. In the bom of RichFaces, the version of JSF-API being used is

       

            <version.com.sun.faces.jsf-api>2.1.0</version.com.sun.faces.jsf-api>

       

      but the version of JSF-IMPL put in use is:

       

                 <version.org.jboss.javax.faces.jsf-impl>2.1.19-jbossorg-1</version.org.jboss.javax.faces.jsf-impl>

       

      Both the version don't seem to go together. Got the following stack-trace:

       

      SEVERE: ContainerBase.addChild: start:

      org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/abc]]

              at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)

              at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)

              at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)

              at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:633)

              at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:977)

              at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1655)

              at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)

              at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)

              at java.util.concurrent.FutureTask.run(Unknown Source)

              at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)

              at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)

              at java.lang.Thread.run(Unknown Source)

      Caused by: java.lang.NullPointerException

              at com.sun.faces.config.InitFacesContext.cleanupInitMaps(InitFacesContext.java:281)

              at com.sun.faces.config.InitFacesContext.<init>(InitFacesContext.java:107)

              at com.sun.faces.config.FacesInitializer.onStartup(FacesInitializer.java:115)

              at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5274)

              at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)

              ... 11 more

       

       

      May 21, 2013 11:30:43 AM org.apache.catalina.startup.HostConfig deployWAR

      SEVERE: Error deploying web application archive F:\DevTools\apache-tomcat-7.0.34\webapps\abc.war

      java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/abc]]

              at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:904)

              at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)

              at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:633)

              at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:977)

              at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1655)

              at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)

              at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)

              at java.util.concurrent.FutureTask.run(Unknown Source)

              at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)

              at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)

              at java.lang.Thread.run(Unknown Source)

       

      I had to manually delete the 2.1.0 jsf-api jar from the war file and copy 2.1.19, with this I was able to bypass this error.

       

      2. Then in next step, I am already using Rewrite-2.0.0.Final, which is clashing with the dependency,

       

            <version.rewrite>1.0.4.Final</version.rewrite>

       

      which is defined in the Richfaces bom.

       

      Exception stacktrace:

           

      SEVERE: Exception starting filter OCPsoft Rewrite Filter

      java.lang.NoSuchMethodError: org.ocpsoft.common.util.Iterators.asUniqueList(Ljava/lang/Iterable;)Ljava/util/List;

                at org.ocpsoft.rewrite.servlet.RewriteFilter.init(RewriteFilter.java:75)

                at org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:278)

                at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:259)

                at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:383)

                at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:104)

                at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4650)

                at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5306)

                at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)

                at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)

                at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)

                at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:633)

                at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1114)

                at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1673)

                at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)

                at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)

                at java.util.concurrent.FutureTask.run(Unknown Source)

                at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)

                at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)

                at java.lang.Thread.run(Unknown Source)

       

      I tried deleting this jar from the war file rewrite-servlet-1.0.4.Final.jar

       

      After this the application gets depoyed correctly without any stacktraces, but still am not able to view the pages, maybe something's still breaking the application.

       

      Few things I am trying to understand here, as you can see the project is built using maven, so is there a way I can ignore these dependencies to make the project deployment?

       

      Are richfaces component incomptaible with rewrite ver. 2.0.0.Final?

       

      Parts of maven, where I have defined the dependency, but it still packages the excluded jar in the war file:

       

           <dependencyManagement>

                    <dependencies>

                         <dependency>

                               <groupId>org.richfaces</groupId>

                               <artifactId>richfaces-bom</artifactId>

                               <version>4.3.2.Final</version>

                               <scope>import</scope>

                               <type>pom</type>

         

                              <exclusions>

                                            <exclusion>

                                                  <groupId>org.ocpsoft.rewrite</groupId>

                                                 <artifactId>rewrite-servlet</artifactId>

                                           </exclusion>

                              </exclusions>

                         </dependency>

                   </dependencies>

             </dependencyManagement>

       



        • 1. Re: Moving from Richfaces 4.1.0.Final to 4.3.2.Final
          Brian Leathem Master

          Unfortunately we included some dependencies we used in our example applications in the RichFaces BOM.  This was a mistake (as reported in RF-12970).  We've corrected this in RichFaces 5.  We were a little reluctant to include this in a RichFaces 4.3.x micro release, as it could be a breaking change for people, but perhaps we should reconsider if this is giving folks problems.

           

          So go ahead and use rewrite 2.0, it will not affect your use of the RichFaces framework (if it does, file an issue!)

           

          The incorrect version number of the JSF-API is an oversight, please file an issue.

           

          Your dependency exclusion has to be done in the <dependencies> section, not in the <dependencyManagement> section.

          1 of 1 people found this helpful
          • 2. Re: Moving from Richfaces 4.1.0.Final to 4.3.2.Final
            Himanshu Bhardwaj Newbie

            Sounds good, I have raised, https://issues.jboss.org/browse/RF-13017 for the JSF-API version issue, for the rewrite issue I have done a work around by not importing the bom-import anymore, rather I am declaring the dependencies as:

             

            <properties>

                    <org.richfaces.bom.version>4.3.2.Final</org.richfaces.bom.version>

            </properties>

             

            <!-- Richfaces dependencies -->

            <dependency>

                  <groupId>org.richfaces.ui</groupId>

                  <artifactId>richfaces-components-ui</artifactId>

                  <version>${org.richfaces.bom.version}</version>

            </dependency>

             

            <dependency>

                    <groupId>org.richfaces.core</groupId>

                    <artifactId>richfaces-core-impl</artifactId>

                    <version>${org.richfaces.bom.version}</version>

            </dependency>

            <!-- Richfaces dependencies Ends here -->