gpt4 book ai didi

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

转载 作者:太空宇宙 更新时间:2023-11-04 07:37:15 27 4
gpt4 key购买 nike

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

我使用的应用服务器是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文件rewrite-servlet-1.0.4.Final.jar中删除这个jar

此后,应用程序已正确部署,没有任何堆栈跟踪,但仍然无法查看页面,也许某些东西仍在破坏应用程序。

这里我想了解一些事情,正如您所看到的,该项目是使用 Maven 构建的,那么有没有办法可以忽略这些依赖项来进行项目部署?

richfaces 组件与重写版本不兼容吗? 2.0.0.最终版?

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

 <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>

最佳答案

关于java - 从 Richfaces-4.1.0.Final 迁移到 Richfaces-4.3.2.Final,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16663397/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com