10 Replies Latest reply on Jun 28, 2010 5:00 AM by ilya_shaikovsky

    Richfaces and Facelets

    struzik

      Hi --

       

      I've tried every just about every combination, but I can't get .xhtml files to render in my Richfaces environment.  Can someone please post working config (web.xml, faces-config.xml) files and what libraries you are using?  I am using the following libraries.  I am unable to use the ui:composition tags because of this. 

       

       

      commons-beanutils-1.7.0.jar
      commons-collections-3.2.jar
      commons-digester-1.8.jar
      commons-logging-1.0.4.jar
      jhighlight-1.0.jar
      jsf-facelets.jar
      ojdbc6.jar
      richfaces-api-3.3.2.SR1.jar
      richfaces-impl-3.3.2.SR1.jar
      richfaces-ui-3.3.2.SR1.jar
      I have attached my config files. 
        • 1. Re: Richfaces and Facelets
          max.katz

          You don't have Facelets configured in faces-config.xml.

           

          <application>
            <view-handler>com.sun.facelets.FaceletViewHandler</view-handler>
           </application>
          

           

          You can also try this template that has RichFaces configured: http://mkblog.exadel.com/ria/richfaces-ria/the-easiest-way-to-start-with-richfaces/

           

          Max

          http://mkblog.exadel.com

           

          1 of 1 people found this helpful
          • 2. Re: Richfaces and Facelets
            struzik

            Thanks, Max.  When I substitute the *.xml files in your example for mine, if I try to call test.jsp I get the following: 

             

            HTTP Status 500 -


            type Exception report

            message

            description The server encountered an internal error () that  prevented it from fulfilling this request.

            exception

            org.apache.jasper.JasperException: java.lang.RuntimeException: Cannot find FacesContext
                 org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:515)
                 org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:411)
                 org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:322)
                 org.apache.jasper.servlet.JspServlet.service(JspServlet.java:249)
                 javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
                 org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
            

             

            root cause

            java.lang.RuntimeException: Cannot find FacesContext
                 javax.faces.webapp.UIComponentClassicTagBase.getFacesContext(UIComponentClassicTagBase.java:1855)
                 javax.faces.webapp.UIComponentClassicTagBase.setJspId(UIComponentClassicTagBase.java:1672)
                 org.apache.jsp.test_jsp._jspx_meth_f_005fview_005f0(test_jsp.java:99)
                 org.apache.jsp.test_jsp._jspService(test_jsp.java:73)
                 org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
                 javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
                 org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:369)
                 org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:322)
                 org.apache.jasper.servlet.JspServlet.service(JspServlet.java:249)
                 javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
                 org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
            

             

            note The full stack trace of the root cause is available in the  JBoss Web/2.1.3.GA logs.

             

             

             

            If I call it as test.jsf I get this:

             

            HTTP Status 404 - /CSMQ/test.jsf


            type Status report

            message /CSMQ/test.jsf

            description The requested resource (/CSMQ/test.jsf) is not  available.


            JBoss Web/2.1.3.GA

             

             

            Again, thanks for your help.


            • 3. Re: Richfaces and Facelets
              ilya_shaikovsky

              you should use xhtml or jspx syntax to define facelets pages (check facelets docs)

              • 4. Re: Richfaces and Facelets
                struzik

                Thanks for the suggestions.  Max, I was able to get your example working, but on JBoss I'm getting this error:

                 

                SEVERE [application] JSF1029: The specified InjectionProvider implementation 'org.jboss.web.jsf.integration.injection.JBossDelegatingInjectionProvider' does not implement the InjectionProvider interface.

                 

                 

                I am trying to do is run some of the examples from the demo that include both RichFaces & Facelets (like the wizard) on JBoss 5.1.0.GA.

                 

                Thanks again.

                • 5. Re: Richfaces and Facelets
                  max.katz

                  The template is for Tomcat. I don't know if that's the cause of the problem but the template has JSF libraries and JBoss AS also has them. You need to remove them from the template.

                   

                  Max

                  http://mkblog.exadel.com

                  • 6. Re: Richfaces and Facelets
                    struzik

                    It took a little digging, but this helped:

                     

                    http://dushyants.blogspot.com/2009/01/error-running-jsf-with-jboss.html

                     

                    thanks again for your help.

                    • 7. Re: Richfaces and Facelets
                      karlkras

                      Hey Tom,

                      So was this all you did to get your JSF 2.0 project to  deploy under JBoss AS 5.1 ?

                       

                      I've commented out the bits as suggested in the link you posted but continue to get deployment errors concerning what appear to be related issues to JSF.

                       

                      regards,

                      Karl

                      • 8. Re: Richfaces and Facelets
                        struzik

                        one more question, Max:  if tried several different configurations but I can't seem to get both JSF pages and XHTML pages to be served simultaneously.  From what I've read this is possible, if not common.  Given your example, can you tell me what changes need to be made?  Or is this a limitation of JBoss 5.1.0?  thanks!

                        • 9. Re: Richfaces and Facelets
                          struzik

                          Hi Karl -- as I noted, I can't get JSF and Facelets to work on JBoss 5.1.0, but those changes I mentioned fixed the other problems I was having.

                          • 10. Re: Richfaces and Facelets
                            ilya_shaikovsky

                            the problems with Jboss could be also caused for example by the fact that the AS contains JSF implementation,. So you should either remove lsf librarites from application or use parameters for jboss to use application bundled ones.