1 2 Previous Next 17 Replies Latest reply on Jun 9, 2010 4:31 AM by matthias_r

    Problem with Richfaces 3.3.3 and JSF 2.0

    firestorm696

      I'm very new to the whole JSF Framework and have Problems integrating Richfaces into my eclipse-Project. I included richfaces-ui-3.3.3.CR1,  richfaces-impl-jsf2-3.3.3.CR1 and richfaces-api-3.3.3.CR1 by putting them into the WEB-INF/lib directory. My web.xml looks like this:

       

      <?xml version="1.0" encoding="UTF-8"?>
      <web-app id="WebApp_ID" version="2.4"
      xmlns="http://java.sun.com/xml/ns/j2ee"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
      <display-name>jsf_test_one</display-name>
      <context-param>
        <param-name>org.richfaces.SKIN</param-name>
        <param-value>blueSky</param-value>
      </context-param>
      <context-param>
        <param-name>org.richfaces.CONTROL_SKINNING</param-name>
        <param-value>enable</param-value>
      </context-param>
      <context-param>
        <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
        <param-value>server</param-value>
      </context-param>
      <context-param>
        <param-name>org.ajax4jsf.VIEW_HANDLERS</param-name>
        <param-value>com.sun.facelets.FaceletViewHandler</param-value>
      </context-param>
      <filter>
        <display-name>RichFaces Filter</display-name>
        <filter-name>richfaces</filter-name>
        <filter-class>org.ajax4jsf.Filter</filter-class>
      </filter>
      <filter-mapping>
        <filter-name>richfaces</filter-name>
        <servlet-name>Faces Servlet</servlet-name>
        <dispatcher>REQUEST</dispatcher>
        <dispatcher>FORWARD</dispatcher>
        <dispatcher>INCLUDE</dispatcher>
      </filter-mapping>
      <servlet>
        <servlet-name>Faces Servlet</servlet-name>
        <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
        <load-on-startup>1</load-on-startup>
      </servlet>
      <servlet-mapping>
        <servlet-name>Faces Servlet</servlet-name>
        <url-pattern>*.jsf</url-pattern>
      </servlet-mapping>
      <login-config>
        <auth-method>BASIC</auth-method>
      </login-config>
      </web-app>

       

      As i start my Tomcat server, it keeps saying:

      SCHWERWIEGEND: Exception sending context initialized event to listener instance of class com.sun.faces.config.ConfigureListener
      java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory
          at org.ajax4jsf.renderkit.ChameleonRenderKitFactory.<clinit>(ChameleonRenderKitFactory.java:50)

       

      and (a few lines later):

      Caused by: java.lang.ClassNotFoundException: org.apache.commons.logging.LogFactory

       

      I got Tomcat 6.0, jdk 1.6.0_18 and jre6. As written in the topic, I'm using JSF 2.

       

      Thanks for help!

        • 1. Re: Problem with Richfaces 3.3.3 and JSF 2.0
          ilya_shaikovsky

          you still need to include commons-* dependencies listed there

          http://docs.jboss.org/richfaces/latest_3_3_X/en/devguide/html/GettingStarted.html#AddingRichFaceslibrariesintotheproject

           

          we will remove this dependencies in 4.x but them still required for 3.x

          1 of 1 people found this helpful
          • 2. Re: Problem with Richfaces 3.3.3 and JSF 2.0
            firestorm696

            Thanks, now I'm able to startup the server but as i call the index file it throws another error:

             

            SCHWERWIEGEND: Exception in the filter chain
            javax.servlet.ServletException: javax/servlet/jsp/jstl/core/Config
                at javax.faces.webapp.FacesServlet.service(FacesServlet.java:321)

            ...

            ...

            ...

            Caused by: java.lang.NoClassDefFoundError: javax/servlet/jsp/jstl/core/Config
                at com.sun.faces.application.view.JspViewHandlingStrategy.executePageToBuildView(JspViewHandlingStrategy.java:360)

            ...

            ...

            ...

            SCHWERWIEGEND: Servlet.service() for servlet Faces Servlet threw exception
            java.lang.NoClassDefFoundError: javax/servlet/jsp/jstl/core/Config
                at com.sun.faces.application.view.JspViewHandlingStrategy.executePageToBuildView(JspViewHandlingStrategy.java:360)

            • 3. Re: Problem with Richfaces 3.3.3 and JSF 2.0
              ilya_shaikovsky
              do you have jstl.jar in classpath?
              • 4. Re: Problem with Richfaces 3.3.3 and JSF 2.0
                firestorm696

                Now I have and it works! Thank you very much!

                 

                Edit: Oh, just saw it... got another problem here:

                 

                04.03.2010 13:35:28 org.ajax4jsf.application.ViewHandlerWrapper fillChain
                SCHWERWIEGEND: Error instantiation parent Faces ViewHandler
                java.lang.ClassNotFoundException: com.sun.facelets.FaceletViewHandler

                • 5. Re: Problem with Richfaces 3.3.3 and JSF 2.0

                  Your web.xml has:

                   

                  <context-param>
                     <param-name>org.ajax4jsf.VIEW_HANDLERS</param-name>
                     <param-value>com.sun.facelets.FaceletViewHandler</param-value>
                  </context-param>

                   

                  The view handler mentioned is only available in jsf-facelets-1.11.X. JSF 2.0 uses facelets by default, and is included in jsf-impl-2.0.x.jar. however that class is not available. I suggest removing the <context-param> and see if that works(At the moment I seem to be having issues as well) or include the jsf-facelets jar which will work. Note that there will be a problem if you try and use <h:outputStylesheet> if jsf-facelet jar s included. I am trying to resolve this myself.

                  1 of 1 people found this helpful
                  • 6. Re: Problem with Richfaces 3.3.3 and JSF 2.0
                    firestorm696

                    Yeah that worked, no more errors while displaying the index-file. Thanks!

                     

                     

                    Okay, got another problem... lol

                     

                    Now none of my h: and f: tags get translated into normal html, the page is simply white with nothing on it. Server throws no more errors!

                    Sorry for my noobism

                    • 7. Re: Problem with Richfaces 3.3.3 and JSF 2.0
                      pmeidl

                      have you solved the <h:outputStylesheet> issue yet? I just ran into the same problem. I followed the instructions in the wiki about using Richfaces 3.3.3 with JSF 2 (i.e. also include the jsf-facelets.jar), but that seems to cause a hickup in the taglibs.

                       

                      I tried with Richfaces 3.3.3.FINAL (which was released a few minutes ago ), but the issue is still there.

                      • 8. Re: Problem with Richfaces 3.3.3 and JSF 2.0
                        jbalunas

                        Could you provide some more details on the issue you are seeing?  Errors, exceptions, related xhtml, etc....

                        • 9. Re: Problem with Richfaces 3.3.3 and JSF 2.0
                          pmeidl

                          when using <h:outputStylesheet in a page template like this:

                           

                          <h:outputStylesheet library="css" name="/css/common.css" target="body"/>

                           

                          I get the following stack trace:

                           

                          com.sun.facelets.tag.TagException: /templates/1col.xhtml @13,72 <h:outputStylesheet> Tag Library supports namespace: http://java.sun.com/jsf/html, but no tag was defined for name: outputStylesheet
                               at com.sun.facelets.compiler.CompilationManager.pushTag(CompilationManager.java:193)
                               at com.sun.facelets.compiler.SAXCompiler$CompilationHandler.startElement(SAXCompiler.java:194)
                               at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(AbstractSAXParser.java:501)
                               at com.sun.org.apache.xerces.internal.parsers.AbstractXMLDocumentParser.emptyElement(AbstractXMLDocumentParser.java:179)
                               at com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.emptyElement(XMLDTDValidator.java:788)
                               at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:377)
                               at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2747)
                               at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:648)
                               at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:140)
                               at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:510)
                               at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:807)
                               at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)
                               at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:107)
                               at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1205)
                               at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:522)
                               at javax.xml.parsers.SAXParser.parse(SAXParser.java:395)
                               at javax.xml.parsers.SAXParser.parse(SAXParser.java:198)
                               at com.sun.facelets.compiler.SAXCompiler.doCompile(SAXCompiler.java:232)
                               at com.sun.facelets.compiler.Compiler.compile(Compiler.java:105)
                               at com.sun.facelets.impl.DefaultFaceletFactory.createFacelet(DefaultFaceletFactory.java:218)
                               at com.sun.facelets.impl.DefaultFaceletFactory.getFacelet(DefaultFaceletFactory.java:149)
                               at com.sun.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:293)
                               at com.sun.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:273)
                               at com.sun.facelets.impl.DefaultFaceletContext.includeFacelet(DefaultFaceletContext.java:140)
                               at com.sun.facelets.tag.ui.CompositionHandler.apply(CompositionHandler.java:113)
                               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:524)
                               at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:567)
                               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:127)
                               at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
                               at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
                               at javax.faces.webapp.FacesServlet.service(FacesServlet.java:313)
                               at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
                               at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                               at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:206)
                               at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)
                               at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:388)
                               at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:515)
                               at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
                               at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
                               at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
                               at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
                               at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
                               at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
                               at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
                               at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
                               at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:852)
                               at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
                               at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
                               at java.lang.Thread.run(Thread.java:637)

                           

                          it's not a big issue, using a <link> tag directly solves the issue. I was just wondering if there will be other tags that won't work when using the facelets jar alongside the jsf2 libs.

                          • 10. Re: Problem with Richfaces 3.3.3 and JSF 2.0
                            firestorm696

                            Gern Raudn schrieb:

                             

                            Yeah that worked, no more errors while displaying the index-file. Thanks!

                             

                             

                            Okay, got another problem... lol

                             

                            Now none of my h: and f: tags get translated into normal html, the page is simply white with nothing on it. Server throws no more errors!

                            Sorry for my noobism

                            stuck with that problem again on richfaces 3.3.3 final

                            • 11. Re: Problem with Richfaces 3.3.3 and JSF 2.0
                              ilya_shaikovsky

                              from http://community.jboss.org/wiki/RichFaces333andJSF20

                               

                              RichFaces 3.3.3 does not support JSF 2 built-in facelets (VDL)

                              Facelets 1.1.15 should still be used because of dependencies in RichFaces from the Tag Handlers classes.

                              JSF 2 native ajax problems

                              f:ajax

                              As RichFaces 3.3.3 does not supports VDL - it does not support any new tags like f:ajax, h:outputScript and so on.  You should continue to use the RichFaces equivalent tags where appropriate.

                              • 12. Re: Problem with Richfaces 3.3.3 and JSF 2.0
                                firestorm696

                                sorry, forgot to mention that this lib is already in my build path. i just don't know what i have to change in my web.xml, so that it's used instead of the built-in jsf 2.0 facelets. could you help me once more?

                                • 13. Re: Problem with Richfaces 3.3.3 and JSF 2.0
                                  ilya_shaikovsky

                                  http://community.jboss.org/wiki/RichFaces333andJSF20

                                   

                                  2) Turn off the VDL viewhandler with the following context-param in web.xml:

                                   

                                  <context-param>      <param-name>javax.faces.DISABLE_FACELET_JSF_VIEWHANDLER</param-name>      <param-value>true</param-value> </context-param>

                                   

                                  • 14. Re: Problem with Richfaces 3.3.3 and JSF 2.0
                                    firestorm696

                                    thanks, now it works yay

                                    1 2 Previous Next