3 Replies Latest reply on Dec 21, 2011 11:47 AM by toskan

    Can't run a JSF/Facelets/Richfaces web app

    akaine

      Hello everyone

      I am having really difficult time trying to deploy a simple web application based on JSF with Facelets and RichFaces implementation under JBoss 5.1.0.GA. I am sure my problem lies in libs incompatibility/duplication. So I've already tried every solution I found in the Internet and still no result. My project uses:

      (all original)
      common-annotations.jar
      commons-beanutils.jar
      commons-collections.jar
      commons-digester.jar
      commons-logging.jar
      el-ri.jar
      jsf-api.jar
      jsf-facelets.jar
      jsf-impl.jar
      jstl.jar
      richfaces-api-3.3.2.GA.jar
      richfaces-impl-3.3.2.GA.jar
      richfaces-ui-3.3.2.GA.jar
      standard.jar


      There are 3 scenarios for me:

      1. I try to deploy the app as it is and when deploying the server responds with:

      Exception sending context initialized event to listener instance of class org.jboss.web.jsf.integration.config.JBossJSFConfigureListener
      com.sun.faces.config.ConfigurationException: CONFIGURATION FAILED! null
       at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:213)
       at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:196)
       at org.jboss.web.jsf.integration.config.JBossJSFConfigureListener.contextInitialized(JBossJSFConfigureListener.java:60)
       at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3910)
      ...


      2. As recommended by some sources I added a parameter to my web.xml:
      <context-param>
       <param-name>org.jboss.jbossfaces.WAR_BUNDLES_JSF_IMPL</param-name>
       <param-value>true</param-value>
      </context-param>

      So when trying to deploy I get:
      java.lang.IllegalStateException: Application was not properly initialized at startup, could not find Factory: javax.faces.context.FacesContextFactory
       at javax.faces.FactoryFinder.getFactory(FactoryFinder.java:267)
       at javax.faces.webapp.FacesServlet.init(FacesServlet.java:164)
       at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1048)
       at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:950)
       at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4122)
       at org.apache.catalina.core.StandardContext.start(StandardContext.java:4421)
      ...


      3. In my project I replace jsf libs for the ones from %JBOSS_HOME/server/default/deploy/jbossweb.sar/jsf-libs/ with or without jboss-faces.jar. The applications deploys without any problems but when I try to render any jsf page I get:
      12:25:29,156 SEVERE [compiler] Missing Built-in Tag Libraries! Make sure they are included within the META-INF directory of Facelets' Jar
      12:25:29,203 SEVERE [viewhandler] Error Rendering View[/start.jspx]
      java.lang.NullPointerException
       at com.sun.facelets.compiler.NamespaceHandler.apply(NamespaceHandler.java:49)
       at com.sun.facelets.compiler.EncodingHandler.apply(EncodingHandler.java:25)
       at com.sun.facelets.impl.DefaultFacelet.apply(DefaultFacelet.java:95)
       at com.sun.facelets.FaceletViewHandler.buildView(FaceletViewHandler.java:503)
       at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:546)
       at org.ajax4jsf.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:100)
       at org.ajax4jsf.application.AjaxViewHandler.renderView(AjaxViewHandler.java:176)
       at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:109)
      ...

      Same happens when I don't export jsf libraries with my war.

      I've already spent several hours trying to solve thing and start to feel pretty much hopeless...

      Any suggestions?

      Thanks in advance.