6 Replies Latest reply on Aug 29, 2007 3:41 PM by Kevin Scott

    Problem with Filter - Recieve 404's when added

    Kevin Scott Newbie

      Hello All,
      I am a new user of RichFaces and I am running into an issue. I am using Tomcat 5.5. I have the following JAR's in my WEB-INF/lib: ajax4jsf-1.1.1.jar, commons-logging.jar,jgroups-all.jar,oscache-2.3.2.jar, and richfaces-3.0.1.jar. I am just trying to get a simple test working, so right now I am not doing anything with the JSP except importing the taglib like so: <%@ taglib uri="http://richfaces.ajax4jsf.org/rich" prefix="rich"%>

      Everything works fine until I add the filter to my web.xml as specified in the RichFaces documentation. The text that I am adding that it causing an issue is:

      <filter>
      <display-name>Ajax4jsf Filter</display-name>
      <filter-name>ajax4jsf</filter-name>
      <filter-class>org.ajax4jsf.Filter</filter-class>
      </filter>
      <filter-mapping>
      <filter-name>ajax4jsf</filter-name>
      <servlet-name>Faces Servlet</servlet-name>
      <dispatcher>REQUEST</dispatcher>
      <dispatcher>FORWARD</dispatcher>
      <dispatcher>INCLUDE</dispatcher>
      </filter-mapping>
      

      Once this is added, I get 404's from everything else in that project (including an empty HTML file. I have checked and the other webapps deployed on the tomcat server are unaffected. I have been unable to figure out what I am doing incorrectly, could some please provide some help?

      Thanks,
      KS

        • 1. Re: Problem with Filter - Recieve 404's when added
          Ilya Shaikovsky Master

          There should be a stacktrace in the server log. please paste it.

          • 2. Re: Problem with Filter - Recieve 404's when added
            Kevin Scott Newbie

            Thanks for the reply! Unforunately, that's the issue, I am not seeing any exceptions or errors, just 404's once the filter is added

            • 4. Re: Problem with Filter - Recieve 404's when added
              Kevin Scott Newbie

              D'oh I thought I had looked throughly, but now I can see the following error:

              java.lang.NoClassDefFoundError: org/apache/commons/collections/map/LRUMap
               at java.lang.ClassLoader.defineClass1(Native Method)
               at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
               at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
               at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:1815)
               at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:869)
               at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1322)
               at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1201)
               at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
               at org.ajax4jsf.cache.LRUMapCacheFactory.createCache(LRUMapCacheFactory.java:49)
               at org.ajax4jsf.framework.resource.InternetResourceService.init(InternetResourceService.java:106)
               at org.ajax4jsf.framework.ajax.xmlfilter.BaseFilter.init(BaseFilter.java:149)
               at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:223)
               at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:304)
               at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:77)
               at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:3634)
               at org.apache.catalina.core.StandardContext.start(StandardContext.java:4217)
               at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:759)
               at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:739)
               at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:524)
               at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:809)
               at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:698)
               at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:472)
               at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1122)
               at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:310)
               at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
               at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1021)
               at org.apache.catalina.core.StandardHost.start(StandardHost.java:718)
               at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1013)
               at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:442)
               at org.apache.catalina.core.StandardService.start(StandardService.java:450)
               at org.apache.catalina.core.StandardServer.start(StandardServer.java:709)
               at org.apache.catalina.startup.Catalina.start(Catalina.java:551)
               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:585)
               at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:294)
               at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:432)


              I guess I need to check my classpath

              • 5. Re: Problem with Filter - Recieve 404's when added
                Nick Belaevski Master

                Hello!

                You are missing commons-collections library. 3.2 version of commons-collections is highly recommended.

                • 6. Re: Problem with Filter - Recieve 404's when added
                  Kevin Scott Newbie

                  Ok, so I replaced the Commons 2.1 which I had with the 3.2 but it seems back to giving 404's, but I have the following error in my tomcat.log:

                  15:41:15,390 [Thread-1] ERROR Error filterStart - org.apache.catalina.core.StandardContext [20070829]
                  


                  Any ideas anyone?