JSF libraries on JBossAS 7.0.1 classpath
rjbaty Aug 25, 2011 4:51 PMI'm working on an application that utilizes JSF on JBossAS 7.0.1. The application uses Spring and the
<el-resolver>org.springframework.web.jsf.el.SpringBeanFacesELResolver</el-resolver>
class to allow for Spring injection into JSF beans. In addition, the Spring libraries are packaged at the EAR level since they are used by multiple modules besides just the JSF WAR.
With this packaging, I initially was getting
java.lang.ClassNotFoundException: javax.faces.context.FacesContext at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:191) [jboss-modules.jar:1.0.1.GA] at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:358) [jboss-modules.jar:1.0.1.GA] at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:330) [jboss-modules.jar:1.0.1.GA] at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:307) [jboss-modules.jar:1.0.1.GA] at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:101) [jboss-modules.jar:1.0.1.GA] at org.springframework.web.jsf.el.SpringBeanFacesELResolver.getWebApplicationContext(SpringBeanFacesELResolver.java:90) [org.springframework.web-3.0.5.RELEASE.jar:] at org.springframework.web.jsf.el.SpringBeanFacesELResolver.getBeanFactory(SpringBeanFacesELResolver.java:79) [org.springframework.web-3.0.5.RELEASE.jar:] at org.springframework.beans.factory.access.el.SpringBeanELResolver.getValue(SpringBeanELResolver.java:50) [org.springframework.beans-3.0.5.RELEASE.jar:]
Which I found strange because I thought the JSF libraries were supposed to be on the classloader by default? To resolve this problem I added the following to the MANFEST.MF of the WAR that uses JSF.
Dependencies: javax.faces.api services
This seems to solve the problem by putting JSF on the classpath but I am wondering why this is happening?
Thanks,
Robert