5 Replies Latest reply on Apr 27, 2010 5:05 AM by ilya_shaikovsky

    RichFaces 3.3.3 and JSF 2.0 & annotations scanning

    jobb

      Hi

       

      During initialization JSF 2 ConfigManager checks for faces-config presence and looks if it's version is equals to 2.0

      My faces-config.xml is placed as usual at WEB-INF and namespace is upgradet to 2.0 and looks like this :


      <?xml version="1.0"?>
      <faces-config
          xmlns="http://java.sun.com/xml/ns/javaee"    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="http://java.sun.com/xml/ns/javaee  http://java.sun.com/xml/ns/javaee/web-facesconfig_2_0.xsd" version="2.0">

       

       

         <!-- declaration under is necessary but without it the code does not work : should be replaced by  @ManagedBean(name="eksempelBean") -->
          <managed-bean>
              <managed-bean-name>eksempelBean</managed-bean-name>
              <managed-bean-class>....EksempelBean</managed-bean-class>
              <managed-bean-scope>session</managed-bean-scope>
          </managed-bean>

      </faces-config>

       

      The bean is using annotations, but ConfigManager to JSF cannot find this.


      @ManagedBean(name="eksempelBean")
      @SessionScoped
      public class EksempelBean extends BaseBean {

           ....

      }


      Question : how to get rid of managed-bean declarations in the faces-config ?

        • 1. Re: RichFaces 3.3.3 and JSF 2.0 & annotations scanning
          ilya_shaikovsky

          I checked with RF-demo in next way:

           

          changed faces-config root element with just copied from the thread your one.

          removed userBean declaration. and added annotations to bean itself.

           

          works fine for me. So seems we need more environment details.

          • 2. Re: RichFaces 3.3.3 and JSF 2.0 & annotations scanning
            jobb

            Thanks for your answer, unfortunately, do not type the demo you used.
            I've checked the examples/photoalbum in interfaces-ui-3-3-3-Final-src.zip, but it uses JSF 1.2 (no annotaion).
            Also, set the RF samples and there I found the pom.xml with all dependences. In profile jsf2_0 I can find a list of dependences for JSF 2.0
            I have the same dependences is in your pom.xml, but the code will not work without the managedBean declaration in faces-config.xml.
            Checked also web.xml, there is no major differences either.

             

            Can you give me a hint on where I can look further?

            • 3. Re: RichFaces 3.3.3 and JSF 2.0 & annotations scanning
              ilya_shaikovsky

              http://jboss.org/richfaces/demos.html there you could download demo for 2.0 and check dependencies.

               

              B.t.w. which JSF implementation you using? And do you using facelets?

              • 4. Re: RichFaces 3.3.3 and JSF 2.0 & annotations scanning
                jobb

                Nothing new in pom.xml on http://anonsvn.jboss.org/repos/richfaces/branches/community/3.3.X/samples/richfaces-demo/pom.xml

                 

                I use

                <properties>
                <jsf.version>2.0.2</jsf.version>    
                <richfacesVersion>3.3.3.Final</richfacesVersion>
                <faceletsVersion>1.1.15.B1</faceletsVersion>
                </properties>

                 

                <dependency><groupId>javax.el</groupId><artifactId>el-api</artifactId><version>1.0</version></dependency>
                <dependency><groupId>com.sun.el</groupId><artifactId>el-ri</artifactId><version>1.0</version></dependency>

                <dependency><groupId>javax.servlet</groupId><artifactId>jstl</artifactId><version>1.2</version><scope>runtime</scope></dependency>

                <dependency><groupId>javax.servlet</groupId><artifactId>servlet-api</artifactId><version>2.5</version><scope>provided</scope></dependency>

                <dependency><groupId>com.sun.faces</groupId><artifactId>jsf-api</artifactId><version>${jsf.version}</version></dependency>
                <dependency><groupId>com.sun.faces</groupId><artifactId>jsf-impl</artifactId><version>${jsf.version}</version></dependency>

                <dependency><groupId>com.sun.facelets</groupId><artifactId>jsf-facelets</artifactId><version>${faceletsVersion}</version></dependency>

                 

                Regards Mirek

                • 5. Re: RichFaces 3.3.3 and JSF 2.0 & annotations scanning
                  ilya_shaikovsky

                  I meant to download war file for JSF 2 and compare settings and libs with your ones.