4 Replies Latest reply on Mar 28, 2011 7:12 PM by Nick Belaevski

    Working Example of a Richfaces 4

    Emerson Cargnin Newbie

      Hi, I've been trying to get a working configuration with Richfaces and JSF 2, but without much success.

       

      I tried to get the examples, but their poms are so complex, with several profiles, etc.

       

      Could someone point me to a working example with richfaces? Including pom, web.xml, faces-config, etc.

       

       

      My project has the following configuration, the error is at the end.

       

      Thanks a lot for the help.

       

      POM:

       

      <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

                xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">

                <modelVersion>4.0.0</modelVersion>

                <groupId>company</groupId>

                <artifactId>TestOrbeon</artifactId>

                <packaging>war</packaging>

                <version>1.0-SNAPSHOT</version>

                <name>TestOrbeon Maven Webapp</name>

                <url>http://maven.apache.org</url>

                <dependencies>

                          <dependency>

                                    <groupId>junit</groupId>

                                    <artifactId>junit</artifactId>

                                    <version>3.8.1</version>

                                    <scope>test</scope>

                          </dependency>

       

       

                          <!-- Hibernate framework for JPA 1.0 -->

                          <dependency>

                                    <groupId>org.hibernate</groupId>

                                    <artifactId>hibernate-entitymanager</artifactId>

                                    <version>3.6.1.Final</version>

                          </dependency>

       

       

                          <dependency>

                                    <groupId>hsqldb</groupId>

                                    <artifactId>hsqldb</artifactId>

                                    <version>1.8.0.7</version>

                          </dependency>

       

       

                          <dependency>

                                    <groupId>log4j</groupId>

                                    <artifactId>log4j</artifactId>

                                    <version>1.2.16</version>

                          </dependency>

       

       

                          <dependency>

                                    <groupId>org.slf4j</groupId>

                                    <artifactId>slf4j-jdk14</artifactId>

                                    <version>1.6.1</version>

                                    <type>jar</type>

                                    <scope>compile</scope>

                          </dependency>

       

       

      <!--                    <dependency>-->

      <!--                              <groupId>org.apache.myfaces.core</groupId>-->

      <!--                              <artifactId>myfaces-api</artifactId>-->

      <!--                              <version>1.2.7</version>-->

      <!--                    </dependency>-->

       

       

                          <dependency>

                                    <groupId>commons-lang</groupId>

                                    <artifactId>commons-lang</artifactId>

                                    <version>${commons.lang.version}</version>

                          </dependency>

       

       

                          <dependency>

                                    <groupId>com.uwyn</groupId>

                                    <artifactId>jhighlight</artifactId>

                                    <version>1.0</version>

                          </dependency>

       

      web.xml:

       

      <?xml version="1.0" encoding="ISO-8859-1"?>

       

       

      <web-app xmlns="http://java.sun.com/xml/ns/javaee

                     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

                     xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"

                     xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"

                     version="2.5">

       

        <display-name>freecologic</display-name>

       

        <context-param>

          <param-name>javax.faces.PROJECT_STAGE</param-name>

          <param-value>Development</param-value>

        </context-param>

       

        <context-param>

                <param-name>javax.faces.STATE_SAVING_METHOD</param-name>

                <param-value>client</param-value>

        </context-param>

       

        <context-param>

                  <param-name>javax.faces.DEFAULT_SUFFIX</param-name>

                  <param-value>.xhtml</param-value>

        </context-param>

       

        <context-param>

          <param-name>com.sun.faces.expressionFactory</param-name>

          <param-value>com.sun.el.ExpressionFactoryImpl</param-value>

        </context-param>

       

        <!-- Configuration for session expiration for Ajax requests -->

        <context-param>

                  <param-name>org.ajax4jsf.handleViewExpiredOnClient</param-name>

                  <param-value>true</param-value>

        </context-param>

       

        <context-param>

                  <param-name>org.apache.myfaces.ERROR_HANDLING</param-name>

                  <param-value>false</param-value>

        </context-param>

       

        <context-param>

                <param-name>org.richfaces.SKIN</param-name>

                <param-value>DEFAULT</param-value>

        </context-param>

       

        <!-- Making the RichFaces skin spread to standard HTML controls -->

        <context-param>

                <param-name>org.richfaces.CONTROL_SKINNING</param-name>

                <param-value>enable</param-value>

        </context-param>

       

        <!-- Defining and mapping the RichFaces filter -->

        <filter>

                <display-name>RichFaces Filter</display-name>

                <filter-name>richfaces</filter-name>

                <filter-class>org.ajax4jsf.Filter</filter-class>

        </filter>

       

        <filter-mapping>

                <filter-name>richfaces</filter-name>

                <servlet-name>Faces Servlet</servlet-name>

                <dispatcher>REQUEST</dispatcher>

                <dispatcher>FORWARD</dispatcher>

                <dispatcher>INCLUDE</dispatcher>

        </filter-mapping>

       

        <listener>

                <listener-class>com.sun.faces.config.ConfigureListener</listener-class>

        </listener>

       

        <servlet>

          <servlet-name>Faces Servlet</servlet-name>

          <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>

          <load-on-startup>0</load-on-startup>

        </servlet>

       

        <servlet-mapping>

          <servlet-name>Faces Servlet</servlet-name>

          <url-pattern>*.faces</url-pattern>

        </servlet-mapping>

       

        <welcome-file-list>

          <welcome-file>index.jsp</welcome-file>

        </welcome-file-list>

       

        <login-config>

                <auth-method>BASIC</auth-method>

        </login-config>

       

        <security-constraint>

                  <web-resource-collection>

                             <web-resource-name>Página Inicial</web-resource-name>

                             <url-pattern>/appview/index.faces</url-pattern>

                  </web-resource-collection>

        </security-constraint>

      </web-app>

       

      faces-config.xml

       

      <?xml version="1.0" encoding="ISO-8859-1"?>

       

       

      <faces-config xmlns="http://java.sun.com/xml/ns/javaee"

                    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

                    xmlns:xi="http://www.w3.org/2001/XInclude"

                    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_2_0.xsd"

                    version="2.0">

       

                <navigation-rule>

                            <navigation-case>

                                       <from-outcome>main</from-outcome>

                                       <to-view-id>/appview/index.faces</to-view-id>

                            </navigation-case>

                           </navigation-rule>

       

                 <application>

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

                 </application>

      </faces-config>

       

                          <dependency>

                                    <groupId>com.sun.faces</groupId>

                                    <artifactId>jsf-api</artifactId>

                                    <version>2.1.0-b03</version>

                          </dependency>

       

       

                          <dependency>

                                    <groupId>com.sun.faces</groupId>

                                    <artifactId>jsf-impl</artifactId>

                                    <version>2.1.0-b03</version>

                          </dependency>

       

       

                          <dependency>

                                    <groupId>jstl</groupId>

                                    <artifactId>jstl</artifactId>

                                    <version>1.2</version>

                          </dependency>

       

       

                          <dependency>

                                    <groupId>javax.servlet</groupId>

                                    <artifactId>servlet-api</artifactId>

                                    <version>2.5</version>

                          </dependency>

       

       

                          <dependency>

                                    <groupId>javax.servlet.jsp</groupId>

                                    <artifactId>jsp-api</artifactId>

                                    <version>2.1</version>

                          </dependency>

       

       

                          <dependency>

                                    <groupId>javax.el</groupId>

                                    <artifactId>el-api</artifactId>

                                    <version>1.0</version>

                          </dependency>

       

       

                          <dependency>

                                    <groupId>el-impl</groupId>

                                    <artifactId>el-impl</artifactId>

                                    <version>1.0</version>

                          </dependency>

       

       

                          <dependency>

                                    <groupId>org.richfaces.ui</groupId>

                                    <artifactId>richfaces-components-ui</artifactId>

                          </dependency>

       

       

                          <dependency>

                                    <groupId>org.richfaces.core</groupId>

                                    <artifactId>richfaces-core-impl</artifactId>

                          </dependency>

       

       

                          <dependency>

                                    <groupId>net.java.dev.ajax4jsf</groupId>

                                    <artifactId>ajax4jsf</artifactId>

                                    <version>1.0.6</version>

                          </dependency>

       

       

                          <dependency>

                                    <groupId>org.hsqldb</groupId>

                                    <artifactId>hsqldb</artifactId>

                                    <version>1.8.0.10</version>

                          </dependency>

                          <dependency>

                                    <groupId>org.hibernate</groupId>

                                    <artifactId>hibernate-core</artifactId>

                                    <version>3.6.1.Final</version>

                          </dependency>

       

       

                          <dependency>

                                    <groupId>org.hibernate</groupId>

                                    <artifactId>hibernate-entitymanager</artifactId>

                                    <version>3.6.1.Final</version>

                                    <exclusions>

                                              <exclusion>

                                                        <groupId>cglib</groupId>

                                                        <artifactId>cglib</artifactId>

                                              </exclusion>

                                              <exclusion>

                                                        <groupId>dom4j</groupId>

                                                        <artifactId>dom4j</artifactId>

                                              </exclusion>

                                    </exclusions>

                          </dependency>

       

       

                          <dependency>

                                    <groupId>org.hibernate.javax.persistence</groupId>

                                    <artifactId>hibernate-jpa-2.0-api</artifactId>

                                    <version>1.0.0.Final</version>

                          </dependency>

       

       

                </dependencies>

       

       

                <properties>

                          <org.richfaces.bom.version>4.0.0.20110227-CR1</org.richfaces.bom.version>

                          <commons.lang.version>2.6</commons.lang.version>

                </properties>

                <dependencyManagement>

                          <dependencies>

                                    <dependency>

                                              <groupId>org.richfaces</groupId>

                                              <artifactId>richfaces-bom</artifactId>

                                              <version>${org.richfaces.bom.version}</version>

                                              <scope>import</scope>

                                              <type>pom</type>

                                    </dependency>

       

       

                                    <dependency>

                                              <groupId>org.slf4j</groupId>

                                              <artifactId>slf4j-api</artifactId>

                                              <version>1.6.1</version>

                                              <type>jar</type>

                                              <scope>compile</scope>

                                    </dependency>

                          </dependencies>

                </dependencyManagement>

       

       

                <build>

                          <finalName>testOrbeon</finalName>

       

       

                          <plugins>

                                    <plugin>

                                              <groupId>org.apache.maven.plugins</groupId>

                                              <artifactId>maven-eclipse-plugin</artifactId>

                                              <version>2.8</version>

                                              <configuration>

                                                        <wtpversion>2.0</wtpversion>

                                                        <downloadJavadocs>true</downloadJavadocs>

                                              </configuration>

                                    </plugin>

                                    <plugin>

                                              <groupId>org.apache.maven.plugins</groupId>

                                              <artifactId>maven-compiler-plugin</artifactId>

                                              <configuration>

                                                        <source>1.6</source>

                                                        <target>1.6</target>

                                              </configuration>

                                    </plugin>

                          </plugins>

                </build>

      </project>

       

      Error:

       

      WARNING: JSF1069: Desativar os Facelets do JSF 2.0 ViewHandler como um FaceletViewHandler antigo, com.sun.facelets.FaceletViewHandler, foi explicitamente configurado. Se este não for um comportamento desejado, remova o FaceletViewHandler antigo e a biblioteca do seu aplicativo.

      22/03/2011 20:07:52 com.sun.faces.config.ConfigManager initialize

      INFO: Unsanitized stacktrace from failed start...

      com.sun.faces.config.ConfigurationException:

        Source Document: jndi:/localhost/TestOrbeon/WEB-INF/faces-config.xml

        Cause: Unable to find class 'com.sun.facelets.FaceletViewHandler'

                at com.sun.faces.config.processor.AbstractConfigProcessor.createInstance(AbstractConfigProcessor.java:269)

                at com.sun.faces.config.processor.ApplicationConfigProcessor.setViewHandler(ApplicationConfigProcessor.java:523)

                at com.sun.faces.config.processor.ApplicationConfigProcessor.processViewHandlers(ApplicationConfigProcessor.java:843)

                at com.sun.faces.config.processor.ApplicationConfigProcessor.process(ApplicationConfigProcessor.java:327)

                at com.sun.faces.config.processor.AbstractConfigProcessor.invokeNext(AbstractConfigProcessor.java:110)

                at com.sun.faces.config.processor.LifecycleConfigProcessor.process(LifecycleConfigProcessor.java:112)

                at com.sun.faces.config.processor.AbstractConfigProcessor.invokeNext(AbstractConfigProcessor.java:110)

                at com.sun.faces.config.processor.FactoryConfigProcessor.process(FactoryConfigProcessor.java:212)

                at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:332)

                at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:222)

                at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3843)

                at org.apache.catalina.core.StandardContext.start(StandardContext.java:4342)

                at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)

                at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)

                at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)

                at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)

                at org.apache.catalina.core.StandardService.start(StandardService.java:516)

                at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)

                at org.apache.catalina.startup.Catalina.start(Catalina.java:578)

                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

                at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

                at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

                at java.lang.reflect.Method.invoke(Method.java:597)

                at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)

                at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)

      Caused by: java.lang.ClassNotFoundException: com.sun.facelets.FaceletViewHandler

                at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1387)

                at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1233)

                at com.sun.faces.util.Util.loadClass(Util.java:287)

                at com.sun.faces.config.processor.AbstractConfigProcessor.loadClass(AbstractConfigProcessor.java:307)

                at com.sun.faces.config.processor.AbstractConfigProcessor.createInstance(AbstractConfigProcessor.java:236)

                ... 24 more

      22/03/2011 20:07:52 com.sun.faces.config.ConfigureListener contextInitialized

      SEVERE: Critical error during deployment:

      com.sun.faces.config.ConfigurationException: CONFIGURATION FAILED! com.sun.facelets.FaceletViewHandler

                at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:351)

                at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:222)

                at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3843)

                at org.apache.catalina.core.StandardContext.start(StandardContext.java:4342)

                at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)

                at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)

                at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)

                at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)

                at org.apache.catalina.core.StandardService.start(StandardService.java:516)

                at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)

                at org.apache.catalina.startup.Catalina.start(Catalina.java:578)

                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

                at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

                at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

                at java.lang.reflect.Method.invoke(Method.java:597)

                at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)

                at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)

      Caused by: java.lang.ClassNotFoundException: com.sun.facelets.FaceletViewHandler

                at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1387)

                at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1233)

                at com.sun.faces.util.Util.loadClass(Util.java:287)

                at com.sun.faces.config.processor.AbstractConfigProcessor.loadClass(AbstractConfigProcessor.java:307)

                at com.sun.faces.config.processor.AbstractConfigProcessor.createInstance(AbstractConfigProcessor.java:236)

                at com.sun.faces.config.processor.ApplicationConfigProcessor.setViewHandler(ApplicationConfigProcessor.java:523)

                at com.sun.faces.config.processor.ApplicationConfigProcessor.processViewHandlers(ApplicationConfigProcessor.java:843)

                at com.sun.faces.config.processor.ApplicationConfigProcessor.process(ApplicationConfigProcessor.java:327)

                at com.sun.faces.config.processor.AbstractConfigProcessor.invokeNext(AbstractConfigProcessor.java:110)

                at com.sun.faces.config.processor.LifecycleConfigProcessor.process(LifecycleConfigProcessor.java:112)

                at com.sun.faces.config.processor.AbstractConfigProcessor.invokeNext(AbstractConfigProcessor.java:110)

                at com.sun.faces.config.processor.FactoryConfigProcessor.process(FactoryConfigProcessor.java:212)

                at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:332)

                ... 16 more

      22/03/2011 20:07:52 org.apache.catalina.core.StandardContext listenerStart

      SEVERE: Exception sending context initialized event to listener instance of class com.sun.faces.config.ConfigureListener

      java.lang.RuntimeException: com.sun.faces.config.ConfigurationException: CONFIGURATION FAILED! com.sun.facelets.FaceletViewHandler

                at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:290)

                at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3843)

                at org.apache.catalina.core.StandardContext.start(StandardContext.java:4342)

                at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)

                at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)

                at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)

                at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)

                at org.apache.catalina.core.StandardService.start(StandardService.java:516)

                at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)

                at org.apache.catalina.startup.Catalina.start(Catalina.java:578)

                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

                at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

                at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

                at java.lang.reflect.Method.invoke(Method.java:597)

                at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)

                at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)

      Caused by: com.sun.faces.config.ConfigurationException: CONFIGURATION FAILED! com.sun.facelets.FaceletViewHandler

                at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:351)

                at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:222)

                ... 15 more

      Caused by: java.lang.ClassNotFoundException: com.sun.facelets.FaceletViewHandler

                at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1387)

                at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1233)

                at com.sun.faces.util.Util.loadClass(Util.java:287)

                at com.sun.faces.config.processor.AbstractConfigProcessor.loadClass(AbstractConfigProcessor.java:307)

                at com.sun.faces.config.processor.AbstractConfigProcessor.createInstance(AbstractConfigProcessor.java:236)

                at com.sun.faces.config.processor.ApplicationConfigProcessor.setViewHandler(ApplicationConfigProcessor.java:523)

                at com.sun.faces.config.processor.ApplicationConfigProcessor.processViewHandlers(ApplicationConfigProcessor.java:843)

                at com.sun.faces.config.processor.ApplicationConfigProcessor.process(ApplicationConfigProcessor.java:327)

                at com.sun.faces.config.processor.AbstractConfigProcessor.invokeNext(AbstractConfigProcessor.java:110)

                at com.sun.faces.config.processor.LifecycleConfigProcessor.process(LifecycleConfigProcessor.java:112)

                at com.sun.faces.config.processor.AbstractConfigProcessor.invokeNext(AbstractConfigProcessor.java:110)

                at com.sun.faces.config.processor.FactoryConfigProcessor.process(FactoryConfigProcessor.java:212)

                at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:332)

                ... 16 more

      22/03/2011 20:07:52 org.apache.catalina.core.StandardContext start

      SEVERE: Error listenerStart

      22/03/2011 20:07:52 org.apache.catalina.core.StandardContext start

      SEVERE: Context [/TestOrbeon] startup failed due to previous errors

      22/03/2011 20:07:53 com.sun.faces.config.ConfigureListener contextDestroyed

      SEVERE: Unexpected exception when attempting to tear down the Mojarra runtime

      java.lang.IllegalStateException: O aplicativo não foi iniciado corretamente na inicialização. Não foi possível encontrar Fábrica: javax.faces.application.ApplicationFactory

                at javax.faces.FactoryFinder$FactoryManager.getFactory(FactoryFinder.java:800)

                at javax.faces.FactoryFinder.getFactory(FactoryFinder.java:302)

                at com.sun.faces.config.InitFacesContext.getApplication(InitFacesContext.java:104)

                at com.sun.faces.config.ConfigureListener.contextDestroyed(ConfigureListener.java:323)

                at org.apache.catalina.core.StandardContext.listenerStop(StandardContext.java:3882)

                at org.apache.catalina.core.StandardContext.stop(StandardContext.java:4523)

                at org.apache.catalina.core.StandardContext.start(StandardContext.java:4387)

                at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)

                at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)

                at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)

                at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)

                at org.apache.catalina.core.StandardService.start(StandardService.java:516)

                at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)

                at org.apache.catalina.startup.Catalina.start(Catalina.java:578)

                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

                at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

                at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

                at java.lang.reflect.Method.invoke(Method.java:597)

                at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)

                at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)

      22/03/2011 20:07:54 org.apache.coyote.http11.Http11Protocol start

      INFO: Starting Coyote HTTP/1.1 on http-8080

        • 1. Working Example of a Richfaces 4
          Pavol Pitonak Master

          Hi Emerson,

           

          you can look at our Auction project https://github.com/qa/auction. It contains JPA+CDI+RichFaces. I know that our examples are not so easy to understand On the other hand, you can use Maven archetype which will generate you a minimalistic project http://docs.jboss.org/richfaces/nightly_4_0_X/Developer_Guide/en-US/html_single/#sect-Developer_Guide-Getting_started_with_RichFaces-Creating_a_project_with_Maven

           

           

          You can try the following in your app:

          1. context param org.richfaces.SKIN was renamed to org.richfaces.skin

          2. context param org.richfaces.CONTROL_SKINNING was renamed

          3. be aware of the fact that there are still some issues with Mojarra 2.1, I suggest you to use Mojarra 2.0.3-b05

          4. remove RichFaces filter + filter mapping from web.xml

          5. remove com.sun.facelets.FaceletViewHandler from faces-config.xml (Facelets are now part of JSF 2)

           

          Regards,

          Palo

           

          P.S.: please post server log in English next time

          • 2. Working Example of a Richfaces 4
            Emerson Cargnin Newbie

            Sorry for the Portuguese on the stacktrace, I don't like that as well.

             

             

            Thanks for the archetype tip.

             

            The only problem is that it shows a few warnings during install:

             

            [WARNING] Some problems were encountered while building the effective model for gov.tresc:OrbeonTestArchetype:war:1.0-SN

            APSHOT

            [WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-compiler-plugin is missing. @ line 39, colum

            n 21

            [WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-war-plugin is missing. @ line 46, column 21

            [WARNING]

            [WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.

            [WARNING]

            [WARNING] For this reason, future Maven versions might no longer support building such malformed projects.

            [WARNING]

            • 3. Working Example of a Richfaces 4
              Emerson Cargnin Newbie

              Actually it is only on the richfaces 4 that shows the error messages in portuguese. I tried setting the locale to en but it doesn't work.

               

              I just created a new app using the archetype, and although it works fine on the browser, the console shows a few weird warnings (translating to english manually). Se further down the console log.

               

              When I try to import the project into eclipse, however,

               

              WARNING: JSF1074: The managed bean named 'a4jSkin' already registered.Replacing the type of bean class managed org.ajax4jsf.framework.skin.SkinBe
              by an org.richfaces.skin.SkinBean.
              03/25/2011 18:43:42 com.sun.faces.config.processor.FaceletTaglibConfigProcessor
              processHandlerClass
              WARNING: JSF1029: The versions of the application Ú 2.0 (explained by versions of / WEB
              -INF/faces-config.xml Or by a ausÛncia / WEB-INF/faces-confg.xml). However,
              the class '[class-handler: null]' depends on a class Facelet legacy. The artifact Facelet represented by this class noo serß registered.
              03/25/2011 18:43:42 com.sun.faces.config.processor.FaceletTaglibConfigProcessor
              processHandlerClass
              WARNING: JSF1029: The versions of the application Ú 2.0 (explained by versions of / WEB
              -INF/faces-config.xml Or by a ausÛncia / WEB-INF/faces-confg.xml). However,
              the class '[class-handler: null]' depends on a class Facelet legacy. The artifact Facelet represented by this class noo serß registered.
              03/25/2011 18:43:42 com.sun.faces.config.processor.FaceletTaglibConfigProcessor
              processHandlerClass
              WARNING: JSF1029: The versions of the application Ú 2.0 (explained by versions of / WEB
              -INF/faces-config.xml Or by a ausÛncia / WEB-INF/faces-confg.xml). However,
              the class '[class-handler: null]' depends on a class Facelet legacy. The artifact Facelet represented by this class noo serß registered.
              03/25/2011 18:43:42 com.sun.faces.config.processor.FaceletTaglibConfigProcessor
              processComponent
              WARNING: JSF1029: The versions of the application Ú 2.0 (explained by versions of / WEB
              -INF/faces-config.xml Or by a ausÛncia / WEB-INF/faces-confg.xml). However,
              the class 'org.ajax4jsf.tag.AjaxSupportHandler' depends on a class Facelet
              legacy. The artifact Facelet represented by this class noo serß registered
              .
              03/25/2011 18:43:42 com.sun.faces.config.processor.FaceletTaglibConfigProcessor
              processComponent
              WARNING: JSF1029: The versions of the application Ú 2.0 (explained by versions of / WEB
              -INF/faces-config.xml Or by a ausÛncia / WEB-INF/faces-confg.xml). However,
              the class 'org.ajax4jsf.tag.AjaxComponentHandler' depends on a class Facelet legacy.The artifact Facelet represented by this class noo serß registered.
              03/25/2011 18:43:42 com.sun.faces.config.processor.FaceletTaglibConfigProcessor
              processComponent
              WARNING: JSF1029: The versions of the application Ú 2.0 (explained by versions of / WEB
              -INF/faces-config.xml Or by a ausÛncia / WEB-INF/faces-confg.xml). However,
              the class 'org.ajax4jsf.tag.AjaxComponentHandler' depends on a class Facelet legacy.The artifact Facelet represented by this class noo serß registered.
              03/25/2011 18:43:42 com.sun.faces.config.processor.FaceletTaglibConfigProcessor
              processComponent
              WARNING: JSF1029: The versions of the application Ú 2.0 (explained by versions of / WEB
              -INF/faces-config.xml Or by a ausÛncia / WEB-INF/faces-confg.xml). However,
              the class 'org.ajax4jsf.tag.AjaxComponentHandler' depends on a class Facelet legacy.The artifact Facelet represented by this class noo serß registered.
              03/25/2011 18:43:42 com.sun.faces.config.processor.FaceletTaglibConfigProcessor
              processComponent
              WARNING: JSF1029: The versions of the application Ú 2.0 (explained by versions of / WEB
              -INF/faces-config.xml Or by a ausÛncia / WEB-INF/faces-confg.xml). However,
              the class 'org.ajax4jsf.tag.ActionParamHandler' depends on a class Facelet
              legacy. The artifact Facelet represented by this class noo serß registered
              .
              03/25/2011 18:43:42 com.sun.faces.config.processor.FaceletTaglibConfigProcessor
              processComponent
              WARNING: JSF1029: The versions of the application Ú 2.0 (explained by versions of / WEB
              -INF/faces-config.xml Or by a ausÛncia / WEB-INF/faces-confg.xml). However,
              the class 'org.ajax4jsf.tag.MediaOutputHandler' depends on a class Facelet
              legacy. The artifact Facelet represented by this class noo serß registered
              .
              03/25/2011 18:43:42 com.sun.faces.config.processor.FaceletTaglibConfigProcessor
              processComponent
              WARNING: JSF1029: The versions of the application Ú 2.0 (explained by versions of / WEB
              -INF/faces-config.xml Or by a ausÛncia / WEB-INF/faces-confg.xml). However,
              the class 'org.ajax4jsf.tag.AjaxComponentHandler' depends on a class Facelet legacy.The artifact Facelet represented by this class noo serß registered.
              03/25/2011 18:43:42 com.sun.faces.config.processor.FaceletTaglibConfigProcessor
              processComponent
              WARNING: JSF1029: The versions of the application Ú 2.0 (explained by versions of / WEB
              -INF/faces-config.xml Or by a ausÛncia / WEB-INF/faces-confg.xml). However,
              the class 'org.ajax4jsf.tag.IncludeHandler' depends on a class Facelet legacy. The artifact Facelet represented by this class noo serß registered.
              03/25/2011 18:43:43 org.richfaces.javascript.ClientServiceConfigParser parse
              WARNING: Found JavaScript function definition for class javax.validation.constraints.NotNull, But That Is Not Presented class
              03/25/2011 18:43:43 org.richfaces.javascript.ClientServiceConfigParser parse
              WARNING: Found JavaScript function definition for class org.hibernate.validator.
              constraints.NotEmpty, But That Is Not Presented class
              03/25/2011 18:43:43 org.richfaces.javascript.ClientServiceConfigParser parse
              WARNING: Found JavaScript function definition for class javax.validation.constraints.Size, But That Is Not Presented class
              03/25/2011 18:43:43 org.richfaces.javascript.ClientServiceConfigParser parse
              WARNING: Found JavaScript function definition for class javax.validation.constraints.Pattern, But That Is Not Presented class
              03/25/2011 18:43:43 org.richfaces.javascript.ClientServiceConfigParser parse
              WARNING: Found JavaScript function definition for class javax.validation.constraints.Min, But That Is Not Presented class
              03/25/2011 18:43:43 org.richfaces.javascript.ClientServiceConfigParser parse
              WARNING: Found JavaScript function definition for class javax.validation.constraints.Max, But That Is Not Presented class
              03/25/2011 18:43:43 org.richfaces.javascript.ClientServiceConfigParser parse
              WARNING: Found JavaScript function definition for class javax.validation.constraints.AssertTrue, But That Is Not Presented class
              03/25/2011 18:43:43 org.richfaces.javascript.ClientServiceConfigParser parse
              WARNING: Found JavaScript function definition for class javax.validation.constraints.AssertFalse, But That Is Not Presented class
              03/25/2011 18:43:43 org.richfaces.cache.CacheManager getCacheFactory
              INFO: Selected factory fallback cache
              03/25/2011 18:43:43 org.richfaces.cache.lru.LRUMapCacheFactory createCache
              INFO: Creating cache instance using parameters LRUMap: {javax.faces.PROJECT_STAG
              E = Development, javax.faces.SKIP_COMMENTS = true}
              03/25/2011 18:43:43 org.richfaces.cache.lru.LRUMapCacheFactory createCache
              INFO: Creating cache instance LRUMap capacity of 512 items
              03/25/2011 18:43:43 org.richfaces.application.InitializationListener onStart
              INFO: Core Implementation by JBoss RichFaces, a division of Red Hat, Inc., version SVN-CR1 v.4.0.0.20110227 r.unknown
              03/25/2011 18:43:43 com.sun.faces.config.ConfigureListener WebConfigResourceMonitor $ $ Monitor <init>
              INFO: Monitoring jndi: / localhost / TestOrbeon / WEB-INF / faces-config.xml for Modifications
              03/25/2011 18:43:43 com.sun.faces.lifecycle.ELResolverInitPhaseListener populate
              FacesELResolverForJsp
              INFO: JSF1027: [null] The ELResolvers for JSF noo were registered with the JSP container.

              • 4. Working Example of a Richfaces 4
                Nick Belaevski Master

                Hi Emerson,

                 

                Can you please check if there are RichFaces 3.x files in your application classpath?