title: Struts2 web.xml file filter jar for web application issue
body: <p>I am currently in the middle of trying to create a small web application using the Struts2 framework. (In eclipse)</p>
  
  <p>I am currently trying to use a filter in the web.xml (in the WEB-INF folder) file to transfer control over to the struts.xml file (in the src folder). (This is what I saw in a tutorial).</p>
  
  <p>The code I am using for the filter is as follows:</p>
  
  <pre><code>&lt;filter&gt; 
  &lt;filter-name&gt;struts2&lt;/filter-name&gt;
  &lt;filter-class&gt;org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter&lt;/filter-class&gt; 
  &lt;/filter&gt; 
  
  &lt;filter-mapping&gt; 
  &lt;filter-name&gt;struts2&lt;/filter-name&gt; 
  &lt;url-pattern&gt;/*&lt;/url-pattern&gt; 
  &lt;/filter-mapping&gt; 
  </code></pre>
  
  <p>I don't think Tomcat is finding the class in the JAR files for the filter as I keep getting this following error:</p>
  
  <blockquote>
    <p>java.lang.NoClassDefFoundError: com/opensymphony/xwork2/ActionContext
        at org.apache.struts2.dispatcher.ng.InitOperations.cleanup(InitOperations.java:114)
        at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.init(StrutsPrepareAndExecuteFilter.java:60)<br>
    ...continues for quite a while.</p>
  </blockquote>
  
  <p>I have the Jar files downloaded from the Struts webpage and the way I went about setting to the build path is as follows:</p>
  
  <p>I right clicked on the project and went to properties</p>
  
  <p>Went to the Java Build Path section and created a new library</p>
  
  <p>Added all of the Jar files to that library and assigned it to this web application's build path</p>
  
  <p>I then added this Jar library to the Deployment Assembly so that when it runs it gets deployed to the WEB-INF/lib folder.</p>
  
  <p>As far as I know this should work, as it works in the tutorial I have followed! However, it is not working for me. </p>
  
  <p>When I run my project and navigate through my PC to where the project is saved, if I look in the WEB-INF/lib folder, there is no Jar files in there whatsoever, could this be where the problem lies? Or is this normal?</p>
  
  <p>Thank you for any help, It's much appreciated!</p>
  
  <p>EDIT</p>
  
  <p>Here are the jar files I am using:</p>
  
  <pre><code>commons-fileupload-1.2.2
  commons-io-2.0.1
  commons-logging-1.1.1
  commons-logging-api-1.1
  freemarker-2.3.19
  javaassist-3.11.0.GA
  ognl-3.0.6
  struts2-core-2.3.8
  xwork-core-2.3.8
  commons-lang-2.4
  </code></pre>
  
  <p>SOLVED - Solved by completely restarting the project on a fresh build!
  UPDATE - Also fixed old build by removing all jars and recreating the jar library, and reassigning it to the build path/Deplyment Assembly (Did this hundreds of times whilst trying to debug, though)</p>
  
  <p>Then removed the old Tomcat server and assigned a new one.</p>
  
  <p>Not entirely sure what fixed it, but it's all working, for now</p>