Error deploying Primefaces application on JBoss 7.1.0

后端 未结 1 1621
耶瑟儿~
耶瑟儿~ 2021-01-20 22:00

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

I am getting the following error:

18:17:03,390 SEVERE [javax.enterprise.resource         


        
1条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-01-20 22:24

    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.

    You have 2 options:

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

    2. 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:

      
          org.jboss.jbossfaces.WAR_BUNDLES_JSF_IMPL
          true
       
      

    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.

    See also:

    • JSF 2 Issues in Application Servers?

    0 讨论(0)
提交回复
热议问题