title: java.lang.IllegalStateException: No filter named encodingFilter while starting spring application
body: <p>I am trying to run a spring application. My web.xml looks </p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &amp;lt;web-app   
   xmlns="http://java.sun.com/xml/ns/j2ee"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" version="2.4"&gt;
  
  
  &lt;context-param&gt;
      &lt;param-name&gt;contextConfigLocation&lt;/param-name&gt;
      &lt;param-value&gt;WEB-INF/beans.xml&lt;/param-value&gt;
  &lt;/context-param&gt;
  
  &lt;listener&gt;
      &lt;listener-class&gt;
          org.springframework.web.context.ContextLoaderListener
      &lt;/listener-class&gt;
  &lt;/listener&gt;
  
  &lt;servlet&gt;
      &lt;servlet-name&gt;CXFServlet&lt;/servlet-name&gt;
      &lt;servlet-class&gt;
          org.apache.cxf.transport.servlet.CXFServlet
      &lt;/servlet-class&gt;
      &lt;load-on-startup&gt;1&lt;/load-on-startup&gt;
  &lt;/servlet&gt;
  
  &lt;servlet-mapping&gt;
      &lt;servlet-name&gt;CXFServlet&lt;/servlet-name&gt;
      &lt;url-pattern&gt;/version/2.0/*&lt;/url-pattern&gt;
  &lt;/servlet-mapping&gt;
  &lt;filter-mapping&gt;
      &lt;filter-name&gt;encodingFilter&lt;/filter-name&gt;
      &lt;url-pattern&gt;/version/2.0/*&lt;/url-pattern&gt;
  &lt;/filter-mapping&gt;
  &lt;filter&gt;
          &lt;filter-name&gt;encodingFilter&lt;/filter-name&gt;
          &lt;filter-class&gt;org.springframework.web.filter.CharacterEncodingFilter&lt;/filter-class&gt;
          &lt;init-param&gt;
              &lt;param-name&gt;encoding&lt;/param-name&gt;
              &lt;param-value&gt;utf-8&lt;/param-value&gt;
          &lt;/init-param&gt;
          &lt;init-param&gt;
              &lt;param-name&gt;forceEncoding&lt;/param-name&gt;
              &lt;param-value&gt;true&lt;/param-value&gt;
          &lt;/init-param&gt;
      &lt;/filter&gt;
  </code></pre>
  
  <p></p>
  
  <p>and i am getting error </p>
  
  <p>java.lang.IllegalStateException: No filter named encodingFilter
      at org.eclipse.jetty.servlet.ServletHandler.updateMappings(ServletHandler.java:1148)
      at org.eclipse.jetty.servlet.ServletHandler.setFilterMappings(ServletHandler.java:1249)
      at org.eclipse.jetty.servlet.ServletHandler.addFilterMapping(ServletHandler.java:1079)</p>
  
  <p>and i am creating a jetty-pkg as jar file and run it as 
  java -jar myjar.jar</p>