从Richfaces-4.1.0.Final迁移到Richfaces-4.3.2.Final

时间:2013-05-21 06:20:40

标签: java jsf-2 richfaces tomcat7 maven-3

最近我试图将我的应用程序从RF-4.1.0.Final升级到RF-4.3.2.Final。

我使用的Application Server是Tomcat-7,项目是使用Maven构建的。

我遇到的问题很少:

1。在RichFaces的bom中,正在使用的JSF-API版本是

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

但正在使用的JSF-IMPL版本是:

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

这两个版本似乎都没有合在一起。得到以下堆栈跟踪:

 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)

我不得不从war文件手动删除2.1.0 jsf-api jar并复制2.1.19,这样我就能绕过这个错误。

2. 然后在下一步中,我已经在使用Rewrite-2.0.0.Final,它与依赖项发生冲突,

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

在Richfaces bom中定义。

异常堆栈跟踪:

 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)

我尝试从war文件中删除此jar文件rewrite-servlet-1.0.4.Final.jar

在此之后,应用程序在没有任何堆栈跟踪的情况下正确地被删除,但仍然无法查看页面,可能还有一些东西仍在破坏应用程序。

我在这里想要了解的很少事情,因为你可以看到项目是使用maven构建的,那么有没有办法可以忽略这些依赖项来进行项目部署?

richfaces组件是否与重写版本无法兼容。 2.0.0.Final?

maven的部分,我已经定义了依赖项,但它仍然在war文件中打包了排除的jar:

 <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 个答案:

答案 0 :(得分:1)

https://community.jboss.org/message/819255#819255

以下是解决方案的链接