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
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:
Remove the webapp-bundled JSF and rely on the server-bundled JSF.
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.