简体   繁体   English

在 JBoss 7.1.0 上部署 Primefaces 应用程序时出错

[英]Error deploying Primefaces application on JBoss 7.1.0

I am trying to deploy a JSF (Primefaces) application in JBOSS 7.1.0.我正在尝试在 JBOSS 7.1.0 中部署一个 JSF (Primefaces) 应用程序。

I am getting the following error:我收到以下错误:

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)

Any ideas?有任何想法吗?

Thanks.谢谢。

This indicates that there's a conflict with another JSF implementation in the webapp's runtime classpath.这表明与 webapp 的运行时类路径中的另一个 JSF 实现存在冲突。 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. 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与应用程序服务器绑定的 JSF。JSF API 部分将从应用程序服务器提供的 JSF 库中加载,但 JSF impl 部分将从 Web 应用程序提供的 882354584445 库中加载If they are of a different version, then you'll get configuration errors like this.如果它们是不同的版本,那么你会得到这样的配置错误。

You have 2 options:您有 2 个选择:

  1. Remove the webapp-bundled JSF and rely on the server-bundled JSF.删除 webapp-bundled JSF 并依赖 server-bundled JSF。

  2. Tell the server to use webapp-bundled JSF instead.告诉服务器改用 webapp-bundled JSF。 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 :在您使用 JBoss 7.x 的特定情况下,这将是将以下上下文参数添加到 webapp 的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 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. Barebones JSP/Servlet 容器,如 Tomcat、Jetty 等未随 JSF 捆绑提供,这就是为什么在针对此类容器时需要在/WEB-INF/lib中提供自己的 JSF 库。

See also:也可以看看:

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM