最近我試圖將我的應用程序從RF-4.1.0.Final升級到RF-4.3.2.Final。從Richfaces-4.1.0.Final遷移到Richfaces-4.3.2.Final
我使用的應用服務器是Tomcat-7,並且該項目是使用Maven構建的。
,我曾面臨幾個問題:
在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)
我不得不從戰爭文件手動刪除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)
我試圖刪除從戰爭文件重寫,servlet的1.0.4.Final.jar
在此之後,應用這個罐子被正確depoyed沒有任何蹤跡,但仍然無法查看頁面,也許某些東西仍然在破壞應用程序。
這裏我想了解的一些東西,你可以看到這個項目是使用maven構建的,那麼是否有一種方法可以忽略這些依賴項以使項目部署?
richfaces組件與rewrite ver不兼容。 2.0.0.Final?
零件行家,在那裏我已經定義了依賴,但它仍然在打包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>