6 Replies Latest reply on Feb 3, 2014 6:47 AM by Adrian Los

    Newbie problems with starting RichFaces

    Adrian Los Newbie

      Dear Forumers,


      I am newbie in the Java EE world. For my programming experience I chose the JBoss Developer Studio, and the JBoss AS 7 server. I use these tools in Fedora 20.

      I'd like to try RichFaces technology. In the Jbdevstudio i create a Dynamic Web Project with Jboss 7.1.1 target runtime, 3.0 dynamic web module version and java server faces 2.0 option and the JSF implementation library type is the Library Provided by Target Runtime.

      When i import these jars i got a lot of error message at the deployment. (Imported Jars: annotations-4.0.0.Final.jar, cssparser-0.9.11.jar, jstl-1.2.jar, sac-1.3.jar, commons-beanutils-1.9.1.jar, guava-15.0.jar, richfaces-components-api-4.3.4.Final.jar, validation-api-1.1.0.Final.jar, commons-collections4-4.0.jar, guava-r08.jar, richfaces-components-ui-4.3.4.Final.jar, commons-digester-2.1.jar, jhighlight-1.0.jar, richfaces-core-api-4.3.4.Final.jar, commons-logging-1.1.3.jar, jsf-facelets-1.1.14.jar, richfaces-core-impl-4.3.4.Final.jar)

      I attached the JBoss AS 7.1.1 log.


      Thank you in advance for any help you can provide.

        • 1. Re: Newbie problems with starting RichFaces
          Pavol Pitonak Master



          1. I'm not sure what causes the error but seems to be a problem with Guava. RichFaces BOM 4.3.4 defines version 13.0.1 so please try to include that version to your project.

          2. If you are new to Java EE world, I suggest you to use Maven-based projects so that all dependencies are managed for you automatically, see [1].

          3. RichFaces 4.3.5 was released recently





          [1] Developer Guide

          • 2. Re: Newbie problems with starting RichFaces
            Adrian Los Newbie

            Dear Pavol,


            Thank you so much, your reply. Maven looks like so easy, but not to me!

            I tried create application with maven some way:



            Command line:

            ...$ mvn archetype:generate -DgroupId=com.frmvnrichgr -DartifactId=frmvnrichaid -DarchetypeArtifactId=richfaces-archetype-simpleapp -DinteractiveMode=false

            The result was build faliure.

            [INFO] Generating project in Batch mode

            [INFO] ------------------------------------------------------------------------

            [INFO] BUILD FAILURE

            [INFO] ------------------------------------------------------------------------

            [INFO] Total time: 7.947s

            [INFO] Finished at: Thu Jan 30 01:52:09 CET 2014

            [INFO] Final Memory: 11M/106M

            [INFO] ------------------------------------------------------------------------

            [ERROR] Failed to execute goal org.apache.maven.plugins:maven-archetype-plugin:2.2:generate (default-cli) on project standalone-pom: The desired archetype does not exist (org.apache.maven.archetypes:richfaces-archetype-simpleapp:1.0) -> [Help 1]


            [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.

            [ERROR] Re-run Maven using the -X switch to enable full debug logging.


            [ERROR] For more information about the errors and possible solutions, please read the following articles:

            [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException



            The next try:

            ...$ mvn archetype:generate -DarchetypeGroupId=org.richfaces.archetypes -DarchetypeArtifactId=richfaces-archetype-simpleapp -DarchetypeVersion=4.3.5.Final -DgroupId=org.docs.richfaces -DartifactId=jsf_project

            It looked like succesful. I created Eclipse form with the mvn eclipse:eclipse. This build was succes too.


            I started my jboss devstudio and i tried to import to my workspace. I've got these error: An internal error occurred during: "Importing Maven projects". Unsupported IClasspathEntry kind=4




            New maven project > richfaces-archetype-simpleapp

            It was create the jsf_project without error. I did mvn clean, and mvn build, and these was succesful.

            I started to deploy to a simple JBossAS7 server, but i've got errors. This is the server log. (edlixlp is my computername)

            I think i'm so close the solution, i hope you can help me.

            • 3. Re: Newbie problems with starting RichFaces
              Pavol Pitonak Master

              Hi, I see two errors in server log. I would focus on first one first because the second one might be related to it.


              There is some problem with configuration of you computer/OS which prevent JBoss AS 7.1.1 from starting successfully. Quick googling pointed me to this post http://stackoverflow.com/questions/4969156/error-java-net-unknownhostexception. Do you use Linux or Mac? If yes, try to update you /etc/hosts file as suggested on that link.

              1 of 1 people found this helpful
              • 4. Re: Newbie problems with starting RichFaces
                Adrian Los Newbie

                Dear Pavol,


                I fixed my problem with your recommendation. Thank you so much!

                It looks like works.


                If you have some patient to me, i would like to ask one more question, and really if your solution working i promise it will be my last question. (Just you know, i'm so happy for your help, and this so hard to learn alone.)


                The sample code ran well, but i would like to try a form from here (RichFaces Showcase).


                I attached the index.xhtml, pom.xml, web.xml and a picture what i see here.

                So with this modification i've got a "Warning: This page calls for XML namespace http://richfaces.org/rich declared with prefix rich but no taglibrary exists for that namespace" message.


                If you know the solution of this problem, i would appreciate if you could share with me.


                If not than i would like to say thank you so much for your help!




                • 5. Re: Newbie problems with starting RichFaces
                  Pavol Pitonak Master



                  there are two problems.


                  The first one is that you're looking on RichFaces 4 Showcase but you use RichFaces 5 in your project. In RF4, we used two namespaces - http://richfaces.org/rich and http://richfaces/a4j. We changed that in RichFaces 5 so that it's easier to use for our users. Now you only need http://richfaces.org which you already have in your xhtml file. You can remove a4j safely, you won't need it.


                  The second problem is that Showcase uses quite complicated mechanism for templating. On one hand it allows us to have these "View Source" links in all samples but on the other hand it prevents you from simply copying the sample to your appliacation. What you need to do is something like this:


                  <html ...>

                  <ui:composition ...>

                      <ui:define name="title">...</ui:define>


                      <ui:define name="body">


                      here you can copy a Showcase sample without ui:composition tag (only its content)






                  • 6. Re: Newbie problems with starting RichFaces
                    Adrian Los Newbie


                    It looks like a really noob mistake, I am sorry for that! I could not check your solution yet, and unfortunately I cannot check until tonight, because I had to travel.
                    In this forenoon I created a simple web application (Dynamic Web Module 3.0, JSF 2.0, JPA 2.1) with RichFaces 4 () without MAven and it works on JBossAS7 & MySQL. Here is the code if you'd like to watch it. (https://dl.dropboxusercontent.com/u/827503/44ums/ItemsApp_jsf_dwp_rfs.zip)
                    However this works, I will try do this app with MAven too, because I am interested using MAven.

                    My goal is the develop a little application with OpenShift use MAven, RichFaces, and MySQL.

                    Thank you so much your patient!