9 Replies Latest reply on Jun 17, 2010 7:39 AM by jbalunas

    RichFaces 4 Alpha 2 Deploy Error

    eurokey

      Hi,

       

      I was exited to try the new Alpha 2 of RichFaces 4.0 but it does not work.

       

      I created a new Java Web Project and added these libraries:

       

          1)  richfaces-commons-api-4.0.0-ALPHA2.jar
          2)  richfaces-core-api-4.0.0-ALPHA2.jar
          3)  richfaces-core-impl-4.0.0-ALPHA2.jar
          4)  richfaces-components-api-4.0.0-ALPHA2.jar
          5)  richfaces-components-impl-4.0.0-ALPHA2.jar
          6)  richfaces-components-ui-4.0.0-ALPHA2.jar
          7)  slf4j-api-1.6.0.jar
          8)  slf4j-log4j12-1.6.0.jar

       

      I build the project -> everything is fine!

      I deploy the project on Glassfish 3.01 -> Error:

       

      Anyone knows what went wrong?

       

      SCHWERWIEGEND: Failed to instantiate SLF4J LoggerFactory
      SCHWERWIEGEND: Reported exception:
      SCHWERWIEGEND: java.lang.NoClassDefFoundError: org/apache/log4j/Level
              at org.slf4j.LoggerFactory.bind(LoggerFactory.java:121)
              at org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:111)
              at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:268)
              at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:241)
          ...
      
        • 1. Re: RichFaces 4 Alpha 2 Deploy Error
          ilya_shaikovsky

          log4j jar also required to be added.

           

          slf4j-log4j12-1.6.0.jar - is not an impl but just binder for log4 (http://www.slf4j.org/manual.html)

           

          Sorry.. our misprint in readme.

          • 2. Re: RichFaces 4 Alpha 2 Deploy Error
            eurokey

            Hi,

             

            thanks for the fast answer.

             

            So now I have these files included:

             

                1)  richfaces-commons-api-4.0.0-ALPHA2.jar
                2)   richfaces-core-api-4.0.0-ALPHA2.jar
                3)   richfaces-core-impl-4.0.0-ALPHA2.jar
                4)   richfaces-components-api-4.0.0-ALPHA2.jar
                5)   richfaces-components-impl-4.0.0-ALPHA2.jar
                6)   richfaces-components-ui-4.0.0-ALPHA2.jar
                7)  slf4j-api-1.6.0.jar
                8)  slf4j-log4j12-1.6.0.jar

                9)  log4j-1.2.16.jar

             

            Glassfish deploys my Application successfully (But shows the follwing errors)

             

            SCHWERWIEGEND: log4j:WARN No appenders could be found for logger (org.richfaces.log.Renderkit).
            SCHWERWIEGEND: log4j:WARN Please initialize the log4j system properly.
            SCHWERWIEGEND: log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
            INFO: Loading application RichFacesTest1 at /RichFacesTest1
            INFO: RichFacesTest1 was successfully deployed in 1.881 milliseconds.

             


            But when my Browser starts it just shows me a new Error:


            "NoClassDefFoundError: org/w3c/css/sac/ErrorHandler"

             

            This Error is not displayed in my Glassfish log.

            • 3. Re: RichFaces 4 Alpha 2 Deploy Error
              jbalunas

              Ilya,

               

              Can you update this page http://community.jboss.org/wiki/HowtoworkwithRichFaces4xexamplessources with this information.  I think we need to adjust how we are packaging the applications. 

               

              I also noticed this, deploying to JBoss AS 6.  However in my case I just removed the slf4j jars and it worked. 

              • 4. Re: RichFaces 4 Alpha 2 Deploy Error
                jbalunas

                Hi Matthias,

                 

                Please try to remove the slf4j, & log4j jars, and see if that has an effect?

                 

                Also you said "it" shows you a new error  "NoClassDefFoundError: org/w3c/css/sac/ErrorHandler", but that it is not in the log.  Where is it shown?

                 

                Thanks,

                Jay

                • 5. Re: RichFaces 4 Alpha 2 Deploy Error
                  eurokey

                  Your wish is my order !

                   

                  1. The Error is shown in my Browser (in the Facelets Error Page)

                   

                   

                  2. I removed the log files and now i have these files includes:

                   

                      1)  richfaces-commons-api-4.0.0-ALPHA2.jar
                      2)   richfaces-core-api-4.0.0-ALPHA2.jar
                      3)   richfaces-core-impl-4.0.0-ALPHA2.jar
                      4)   richfaces-components-api-4.0.0-ALPHA2.jar
                      5)   richfaces-components-impl-4.0.0-ALPHA2.jar
                      6)   richfaces-components-ui-4.0.0-ALPHA2.jar

                   

                  It did not work you can find the error message in the attached file.

                   

                  3. Ok I played a little and now I have the following files included:

                   

                      1)  richfaces-commons-api-4.0.0-ALPHA2.jar
                      2)    richfaces-core-api-4.0.0-ALPHA2.jar
                      3)    richfaces-core-impl-4.0.0-ALPHA2.jar
                      4)    richfaces-components-api-4.0.0-ALPHA2.jar
                      5)    richfaces-components-impl-4.0.0-ALPHA2.jar
                      6)    richfaces-components-ui-4.0.0-ALPHA2.jar

                      7)  slf4j-api-1.6.0.jar

                      8)  slf4j-nop-1.6.0.jar

                   

                  Now everything seems ok. Glassfish shows me neither warnings nor errors. But i still get the  "NoClassDefFoundError: org/w3c/css/sac/ErrorHandler" Error. The funny thing is right now i don't use any richfaces component all I got is a IDE generated index.xhtml:

                  <?xml version='1.0' encoding='UTF-8' ?>
                  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
                  <html xmlns="http://www.w3.org/1999/xhtml"
                        xmlns:h="http://java.sun.com/jsf/html">
                      <h:head>
                          <title>Facelet Title</title>
                      </h:head>
                      <h:body>
                          Hello from Facelets
                      </h:body>
                  </html>
                  

                   

                  If i remove all libraries the page is displayed like it should

                  • 6. Re: RichFaces 4 Alpha 2 Deploy Error
                    jbalunas

                    Quick question - are you using maven to build your application?  If you imported the richfaces-component-bom following - http://community.jboss.org/wiki/HowtoaddRichFaces4xtomavenbasedproject it should have been downloaded for you.

                     

                    Either way we need to document that better, and I thank you for finding this.  The missing jars are cssparser, and its dependency sac.jar. 

                     

                     

                    If you are not using Maven then you can download the missing jars here:

                     

                    Please let us know if that fixes the issue for you?  I'll also create a jira to cover documenting this.

                     

                    Thanks,

                    Jay

                     

                    Dependency tree for the showcase demo:

                    [INFO] [dependency:tree]
                    [INFO] org.richfaces.examples:richfaces-showcase:war:4.0.0.Alpha2
                    [INFO] +- org.richfaces.ui:richfaces-components-ui:jar:4.0.0.Alpha2:compile
                    [INFO] |  +- org.richfaces.ui:richfaces-components-impl:jar:4.0.0.Alpha2:compile
                    [INFO] |  |  \- org.richfaces.ui:richfaces-components-api:jar:4.0.0.Alpha2:compile
                    [INFO] |  +- org.richfaces.core:richfaces-core-api:jar:4.0.0.Alpha2:compile
                    [INFO] |  +- org.richfaces.core:richfaces-core-impl:jar:4.0.0.Alpha2:compile
                    [INFO] |  |  \- net.sourceforge.cssparser:cssparser:jar:0.9.5:compile
                    [INFO] |  |     \- org.w3c.css:sac:jar:1.3:compile
                    [INFO] |  \- org.richfaces.commons:richfaces-commons-api:jar:4.0.0.Alpha2:compile
                    [INFO] +- com.sun.faces:jsf-api:jar:2.0.2:compile
                    [INFO] +- com.sun.faces:jsf-impl:jar:2.0.2:compile
                    [INFO] +- javax.servlet:servlet-api:jar:2.5:provided
                    [INFO] +- javax.servlet.jsp:jsp-api:jar:2.1:provided
                    [INFO] +- javax.el:el-api:jar:1.0:provided
                    [INFO] +- javax.servlet:jstl:jar:1.2:compile
                    [INFO] +- net.sf.ehcache:ehcache:jar:1.6.0:compile
                    [INFO] +- org.slf4j:slf4j-log4j12:jar:1.5.8:compile
                    [INFO] |  \- org.slf4j:slf4j-api:jar:1.5.8:compile
                    [INFO] \- log4j:log4j:jar:1.2.14:compile
                    
                    • 7. Re: RichFaces 4 Alpha 2 Deploy Error
                      max.katz

                      I was able to run with just sac.jar, I didn't add cssparser.jar.

                       

                      Max

                      http://mkblog.exadel.com

                      • 8. Re: RichFaces 4 Alpha 2 Deploy Error
                        eurokey

                        No right now I'm not using Maven. I just created a new Web Project in Netbeans 6.9.

                         

                        So I added these two files to my Project and put an a4j:commandButton on my index.xhmtl

                         

                        First sac1.3.jar -> The Project deoployed with no errors the a4j:commandButton was shown but looked exactely like the h:commandButton.

                        After I added cssparser-0.9.5.jar some styles where added to the a4j:commandButton. So I guess both files are necessary.

                         

                        Ok guys thanks for the help!

                        • 9. Re: RichFaces 4 Alpha 2 Deploy Error
                          jbalunas

                          Thanks you for working it out with us ;-)

                           

                          The sac jar fixed the class not found issue, but the cssparser was needed to adapt the skins.

                           

                          -Jay