1 Reply Latest reply on Mar 4, 2010 12:57 PM by jbalunas

    Getting started with Richfaces 4.0 in JSF 2.0?


      Hello All,

      I am writing a Java EE 6 application on Glassfish Web Profile using JSF 2.0, CDI, etc.


      I found that I need a file upload component and wanted to see if I could use Richfaces for it. I fully understand that it is very early alpha, unsupported, etc, but for a single, presumably-simple, component, that is fine for my client's needs.


      Can I view the demo somewhere?  I'd prefer to actually see the components to see if they are what we need before I download or build the application.


      I had a few questions about the build procedure.


      Is it documented somewhere that maybe I missed it?

      I found http://www.jboss.org/richfaces/sourcecode.html  which points to http://anonsvn.jboss.org/repos/richfaces/root.  I see that that root has a pom.xml, but when that repo location checks out 30mb of source.  That URL leads to downloading all tags, branches, and trunk for the project.


      Is the build procedure...:

      svn co http://anonsvn.jboss.org/repos/richfaces/root richfaces

      cd richfaces

      mvn install


      When I do that, I get a build error on CDK:


      An annotation processor threw an uncaught exception.
      Consult the following stack trace for details.
      java.lang.StringIndexOutOfBoundsException: String index out of range: 1
          at java.lang.String.substring(String.java:1934)
          at org.richfaces.cdk.generate.taglib.TaglibGeneratorVisitor.getTagName(TaglibGeneratorVisitor.java:91)
          at org.richfaces.cdk.generate.taglib.TaglibGeneratorVisitor.getComponentTagName(TaglibGeneratorVisitor.java:78)
          at org.richfaces.cdk.generate.taglib.TaglibGeneratorVisitor.visitComponent(TaglibGeneratorVisitor.java:62)
          at org.richfaces.cdk.model.ComponentModel.accept(ComponentModel.java:63)
          at org.richfaces.cdk.model.ComponentLibrary.visitCollection(ComponentLibrary.java:144)
          at org.richfaces.cdk.model.ComponentLibrary.accept(ComponentLibrary.java:127)
          at org.richfaces.cdk.generate.taglib.TaglibWriter.render(TaglibWriter.java:54)
          at org.richfaces.cdk.apt.AptBuilder.generate(AptBuilder.java:70)
          at org.richfaces.cdk.apt.CdkProcessor.process(CdkProcessor.java:96)
          at com.sun.tools.javac.processing.JavacProcessingEnvironment.callProcessor(JavacProcessingEnvironment.java:624)
          at com.sun.tools.javac.processing.JavacProcessingEnvironment.access$000(JavacProcessingEnvironment.java



      Am I doing something incorrectly?



        • 1. Re: Getting started with Richfaces 4.0 in JSF 2.0?

          Hi Steven,


          Glad to see you trying out RichFaces 4.0.  We do not have a the fileupload component ready in the 4.0 branch.  Although it is available in the 3.3.X branch, but our JSF 2.0 support there has some limitations - http://community.jboss.org/wiki/RichFaces333andJSF20


          The demo is not currently hosted, as it is so early in the release cycle.  We plan to have the demo hosted in one of the first milestone releases.


          The build instructions for the 4.0 release are not posted - but I did just create a jira for it - https://jira.jboss.org/jira/browse/RFPL-436


          For 4.0 we are structured more like weld and seam 3 where we have separate modules that have their own tags, branches, etc...


          To build from the root directory you need to use the "trunk" mvn profile so that the build knows what version of the modules to build.  You should set up the snapshot repos following these instructions - http://community.jboss.org/wiki/HowToConfigureMavenForRichFaces


          Making this easier is one of the very near term tasks and this will be documented for Alpha2.


          I'm glad you giving this a shot and please let us know if you into other issues.  Please bear in mind that this is just alpha code and there-fore not the most stable ;-)