4 Replies Latest reply on Jan 3, 2011 7:04 AM by Ilya Sorokoumov

    Richfaces 4 in a maven project

    Benny Malev Newbie

      Hello.

      In my pom.xml i have:

       

      <dependencyManagement>
              <dependencies>
                  <dependency>
                      <groupId>org.richfaces</groupId>
                      <artifactId>richfaces-bom</artifactId>
                      <version>${org.richfaces.bom.version}</version>
                      <scope>import</scope>
                      <type>pom</type>
                  </dependency>
              </dependencies>
          </dependencyManagement>

      <dependencyManagement>

              <dependencies>

                  <dependency>

                      <groupId>org.richfaces</groupId>

                      <artifactId>richfaces-bom</artifactId>

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

                      <scope>import</scope>

                      <type>pom</type>

                  </dependency>

              </dependencies>

          </dependencyManagement>

       

      <dependencies>

      ...

           <dependency>

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

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

          </dependency>

      ...

      </dependencies>

       

      <properties>

          <org.springframework.version>3.0.0.RELEASE</org.springframework.version>

          <org.richfaces.bom.version>4.0.0.20101110-M4</org.richfaces.bom.version>

      </properties>

       

      and in web.xml :

       

      <?xml version="1.0" encoding="UTF-8"?>

      <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" 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_3_0.xsd" id="WebApp_ID" version="3.0">

        <display-name>Web Application</display-name>

       

        <servlet>

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

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

          <load-on-startup>1</load-on-startup>

        </servlet>

       

        <servlet-mapping>

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

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

        </servlet-mapping>

       

        <context-param>

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

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

        </context-param>

       

      <context-param>

         <param-name>contextConfigLocation</param-name>

         <param-value>/WEB-INF/spring-context.xml</param-value>

      </context-param>

      <listener>

         <listener-class>org.springframework.web.context.ContextLoaderListener

         </listener-class>

      </listener>

       

      <!-- richfaces -->

      <!-- Plugging the "Blue Sky" skin into the project -->

      <context-param>

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

         <param-value>blueSky</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>

      </web-app>

       

      and i get an error when running on tomcat 7 (during startup):

      java.lang.ClassNotFoundException: org.ajax4jsf.Filter

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

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

      at org.apache.catalina.core.DefaultInstanceManager.loadClass(DefaultInstanceManager.java:415)

      at org.apache.catalina.core.DefaultInstanceManager.loadClassMaybePrivileged(DefaultInstanceManager.java:397)

      at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:118)

      at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:252)

      at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:372)

      at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:98)

      at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4405)

      at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5037)

      at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:140)

      at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1035)

      at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:738)

      at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:140)

      at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1035)

      at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:289)

      at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:140)

      at org.apache.catalina.core.StandardService.startInternal(StandardService.java:442)

      at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:140)

      at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:674)

      at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:140)

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

      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:303)

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

      02/01/2011 23:20:07 org.apache.catalina.core.StandardContext startInternal

      SEVERE: Error filterStart

       

      please help!