本文介绍了在JBoss 7.1.0上部署Primefaces应用程序时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在JBOSS 7.1.0中部署JSF(Primefaces)应用程序。

I am trying to deploy a JSF (Primefaces) application in JBOSS 7.1.0.

我收到以下错误:

18:17:03,390 SEVERE [javax.enterprise.resource.webcontainer.jsf.config] (MSC
service thread 1-8) Critical error during deployment: :
com.sun.faces.config.ConfigurationException:Factory
'javax.faces.context.PartialViewContextFactory' was not configured properly.
    at com.sun.faces.config.processor.FactoryConfigProcessor.verifyFactories
Exist(FactoryConfigProcessor.java:305) [jsf-impl-2.1.5-jbossorg-1.jar:2.1.5-SNAP
SHOT]
    at com.sun.faces.config.processor.FactoryConfigProcessor.process(Factory
ConfigProcessor.java:219) [jsf-impl-2.1.5-jbossorg-1.jar:2.1.5-SNAPSHOT]
    at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:361)
[jsf-impl-2.1.5-jbossorg-1.jar:2.1.5-SNAPSHOT]
    at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureLi
stener.java:225) [jsf-impl-2.1.5-jbossorg-1.jar:2.1.5-SNAPSHOT]
    at org.apache.catalina.core.StandardContext.contextListenerStart(Standar
dContext.java:3392) [jbossweb-7.0.10.Final.jar:]
    at org.apache.catalina.core.StandardContext.start(StandardContext.java:3
850) [jbossweb-7.0.10.Final.jar:]
    at org.jboss.as.web.deployment.WebDeploymentService.start(WebDeploymentS
ervice.java:90) [jboss-as-web-7.1.0.Final.jar:7.1.0.Final]
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(Se
rviceControllerImpl.java:1811)
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceCont
rollerImpl.java:1746)

任何想法?

谢谢。

推荐答案

这表明有与webapp的运行时类路径中的另一个JSF实现发生冲突。完整的Java EE应用服务器,如JBoss AS,Glassfish,WebSphere,Weblogic等已经捆绑了JSF,因为它是Java EE API的一部分。如果你在webapp的 / WEB-INF / lib 中提供JSF,它可能会与appserver-bundled JSF冲突。 JSF API部分将从appserver提供的JSF库加载,但JSF impl部分将从webapp提供的JSF库加载。如果它们是不同的版本,那么你会得到这样的配置错误。

This indicates that there's a conflict with another JSF implementation in the webapp's runtime classpath. Full fledged Java EE application servers like JBoss AS, Glassfish, WebSphere, Weblogic, etc already ship with JSF bundled since that's part of the Java EE API. If you supply JSF in your webapp's /WEB-INF/lib as well, it may conflict with the appserver-bundled JSF. The JSF API part will be loaded from the appserver-provided JSF libraries, but the JSF impl part will be loaded from the webapp-provided JSF libraries. If they are of a different version, then you'll get configuration errors like this.

你有2个选择:


  1. 删除webapp-bundled JSF并依赖服务器捆绑的JSF。

  1. Remove the webapp-bundled JSF and rely on the server-bundled JSF.

告诉服务器使用webapp-bundled JSF代替。如何做到这取决于服务器make / version。在您使用JBoss 7.x的特定情况下,可以将以下上下文参数添加到webapp的 web.xml

Tell the server to use webapp-bundled JSF instead. How to do that depends on the server make/version. In your particular case with JBoss 7.x, that would be a matter of adding the following context parameter to webapp's web.xml:

<context-param>
    <param-name>org.jboss.jbossfaces.WAR_BUNDLES_JSF_IMPL</param-name>
    <param-value>true</param-value>
</context-param>


Barebones JSP / Servlet容器,如Tomcat,Jetty ,等等不附带JSF捆绑,这就是为什么在定位这样的容器时你需要在 / WEB-INF / lib 中提供自己的JSF库。

Barebones JSP/Servlet containers like Tomcat, Jetty, etc doesn't ship with JSF bundled, that's why you would need to provide your own JSF libraries in /WEB-INF/lib when targeting such containers.



  • JSF 2 Issues in Application Servers?

这篇关于在JBoss 7.1.0上部署Primefaces应用程序时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-25 10:02