Hello i was trying to deploy a web app of my office mates, here is the error:

ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/mb-web-0.0.1-SNAPSHOT].[Faces Servlet]] Servlet.service() for servlet Faces Servlet threw exception: java.lang.ClassNotFoundException: javax.faces.context.FacesContext from BaseClassLoader@161bfa3{vfs:///apps/jboss/server/default/conf/jboss-service.xml}
at org.jboss.classloader.spi.base.BaseClassLoader.loadClass(BaseClassLoader.java:480) [jboss-classloader.jar:2.2.0.GA]
at java.lang.ClassLoader.loadClass(ClassLoader.java:252) [:1.6.0_10]
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320) [:1.6.0_10]
at org.springframework.web.jsf.el.SpringBeanFacesELResolver.getWebApplicationContext(SpringBeanFacesELResolver.java:89) [:2.5.6]
at org.springframework.web.jsf.el.SpringBeanFacesELResolver.getBeanFactory(SpringBeanFacesELResolver.java:78) [:2.5.6]
at org.springframework.beans.factory.access.el.SpringBeanELResolver.getValue(SpringBeanELResolver.java:49) [:2.5.6]
at com.sun.faces.el.DemuxCompositeELResolver._getValue(DemuxCompositeELResolver.java:176) [:2.1.2-FCS]
at com.sun.faces.el.DemuxCompositeELResolver.getValue(DemuxCompositeELResolver.java:203) [:2.1.2-FCS]
at org.apache.el.parser.AstIdentifier.getValue(AstIdentifier.java:67) [:6.0.0.Final]
at org.apache.el.parser.AstValue.getValue(AstValue.java:115) [:6.0.0.Final]
at org.apache.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:187) [:6.0.0.Final]
at com.sun.faces.facelets.el.TagValueExpression.getValue(TagValueExpression.java:109) [:2.1.2-FCS]
at javax.faces.component.ComponentStateHelper.eval(ComponentStateHelper.java:194) [:2.1.2-FCS]
at javax.faces.component.ComponentStateHelper.eval(ComponentStateHelper.java:182) [:2.1.2-FCS]
at javax.faces.component.UIData.getValue(UIData.java:731) [:2.1.2-FCS]
at org.primefaces.component.datatable.DataTable.getValue(DataTable.java:789) [:]
at javax.faces.component.UIData.getDataModel(UIData.java:1798) [:2.1.2-FCS]
at javax.faces.component.UIData.getRowCount(UIData.java:356) [:2.1.2-FCS]
at org.primefaces.component.datatable.DataTable.calculatePage(DataTable.java:749) [:]
at org.primefaces.component.datatable.DataTableRenderer.encodeMarkup(DataTableRenderer.java:185) [:]
at org.primefaces.component.datatable.DataTableRenderer.encodeEnd(DataTableRenderer.java:95) [:]
at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:875) [:2.1.2-FCS]
at org.primefaces.renderkit.CoreRenderer.renderChild(CoreRenderer.java:63) [:]
at org.primefaces.renderkit.CoreRenderer.renderChildren(CoreRenderer.java:47) [:]
at org.primefaces.component.panel.PanelRenderer.encodeContent(PanelRenderer.java:184) [:]
at org.primefaces.component.panel.PanelRenderer.encodeMarkup(PanelRenderer.java:107) [:]
at org.primefaces.component.panel.PanelRenderer.encodeEnd(PanelRenderer.java:55) [:]
at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:875) [:2.1.2-FCS]
at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.encodeRecursive(HtmlBasicRenderer.java:312) [:2.1.2-FCS]
at com.sun.faces.renderkit.html_basic.GridRenderer.renderRow(GridRenderer.java:185) [:2.1.2-FCS]
at com.sun.faces.renderkit.html_basic.GridRenderer.encodeChildren(GridRenderer.java:129) [:2.1.2-FCS]
at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:845) [:2.1.2-FCS]
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1756) [:2.1.2-FCS]
at javax.faces.render.Renderer.encodeChildren(Renderer.java:168) [:2.1.2-FCS]
at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:845) [:2.1.2-FCS]
at org.primefaces.renderkit.CoreRenderer.renderChild(CoreRenderer.java:59) [:]
at org.primefaces.renderkit.CoreRenderer.renderChildren(CoreRenderer.java:47) [:]
at org.primefaces.component.panel.PanelRenderer.encodeContent(PanelRenderer.java:184) [:]
at org.primefaces.component.panel.PanelRenderer.encodeMarkup(PanelRenderer.java:107) [:]
at org.primefaces.component.panel.PanelRenderer.encodeEnd(PanelRenderer.java:55) [:]
at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:875) [:2.1.2-FCS]
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1763) [:2.1.2-FCS]
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1759) [:2.1.2-FCS]
at org.primefaces.component.tabview.TabViewRenderer.encodeTabContent(TabViewRenderer.java:228) [:]
at org.primefaces.component.tabview.TabViewRenderer.encodeContents(TabViewRenderer.java:201) [:]
at org.primefaces.component.tabview.TabViewRenderer.encodeMarkup(TabViewRenderer.java:120) [:]
at org.primefaces.component.tabview.TabViewRenderer.encodeEnd(TabViewRenderer.java:68) [:]
at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:875) [:2.1.2-FCS]
at org.primefaces.renderkit.CoreRenderer.renderChild(CoreRenderer.java:63) [:]
at org.primefaces.renderkit.CoreRenderer.renderChildren(CoreRenderer.java:47) [:]
at org.primefaces.component.layout.LayoutUnitRenderer.encodeEnd(LayoutUnitRenderer.java:51) [:]
at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:875) [:2.1.2-FCS]
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1763) [:2.1.2-FCS]
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1759) [:2.1.2-FCS]
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1759) [:2.1.2-FCS]
at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1759) [:2.1.2-FCS]
at com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:401) [:2.1.2-FCS]
at com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:131) [:2.1.2-FCS]
at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:121) [:2.1.2-FCS]
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101) [:2.1.2-FCS]
at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139) [:2.1.2-FCS]
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:594) [:2.1.2-FCS]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:324) [:6.0.0.Final]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:242) [:6.0.0.Final]
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275) [:6.0.0.Final]
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) [:6.0.0.Final]
at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:181) [:6.0.0.Final]
at org.jboss.modcluster.catalina.CatalinaContext$RequestListenerValve.event(CatalinaContext.java:285) [:1.1.0.Final]
at org.jboss.modcluster.catalina.CatalinaContext$RequestListenerValve.invoke(CatalinaContext.java:261) [:1.1.0.Final]
at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:88) [:6.0.0.Final]
at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:100) [:6.0.0.Final]
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) [:6.0.0.Final]
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) [:6.0.0.Final]
at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158) [:6.0.0.Final]
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) [:6.0.0.Final]
at org.jboss.web.tomcat.service.request.ActiveRequestResponseCacheValve.invoke(ActiveRequestResponseCacheValve.java:53) [:6.0.0.Final]
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:362) [:6.0.0.Final]
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877) [:6.0.0.Final]
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:654) [:6.0.0.Final]
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:951) [:6.0.0.Final]
at java.lang.Thread.run(Thread.java:619) [:1.6.0_10]

1 Answer
1

java.lang.ClassNotFoundException: javax.faces.context.FacesContext from BaseClassLoader@161bfa3{vfs:///apps/jboss/server/default/conf/jboss-service.xml}
at org.jboss.classloader.spi.base.BaseClassLoader.loadClass(BaseClassLoader.java:480) [jboss-classloader.jar:2.2.0.GA]
at java.lang.ClassLoader.loadClass(ClassLoader.java:252) [:1.6.0_10]
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320) [:1.6.0_10]
at org.springframework.web.jsf.el.SpringBeanFacesELResolver.getWebApplicationContext(SpringBeanFacesELResolver.java:89) [:2.5.6]

This suggests that SpringBeanFacesELResolver is been loaded by the JBoss server level classloader instead of the WAR level classloader. Since JBoss 6.0, JSF is only available in the WAR level classloader. See also http://community.jboss.org/wiki/JSFOnJBossAS6.

In your jboss/apps/server/default/lib listing I see several classes which are supposed to be used by WARs only, not by the server. I think that almost all JARs which you listed there really belongs in /WEB-INF/lib. There's also spring-web JAR in there which in turn confirms the cause of this exception. This JAR needs to be in WAR in order to fix this particular exception. From the listing, I think that only the mysql-connector-java-5.1.6.jar is fine there, assuming that you're using a server-managed data source which needs that JAR.

Uhm can you tell me which jar should be in web-in/lib and which should be in jboss/lib?? i tried to put spring web in webinf/lib and error in deployment, then i put all spring* jar in jboss/lib and getting same error..thank you
–
Lynx777Nov 1 '11 at 3:32

You should remove webapp-specific JARs from jboss/lib and put them in /WEB-INF/lib. You should only put server-specific JARs in jboss/lib (for example, the JDBC drivers which are to be used by JBoss-managed JBDC connection pools).
–
BalusCNov 1 '11 at 11:59

Well to be honest i tried these methods last night: -Removing same library -Updating lib version in jboss/lib -removing java ee web api and servlet api (i read that these two should not be included in weapps) -About Spring it seems jboss need it so i still have spring 2.5.6 spring web 2.5.6 spring test 2.5.6 and spring aop 2.5.6 in my jboss/lib if i remove it or move it to web-inf/lib it will have error while booting.. - I also tried configure my jsf.deployer like in the link you gave me, but it didn't work
–
Lynx777Nov 2 '11 at 6:14