title: Unable to deploy my spring web project to eclipse internal tomcat server.(java.lang.ClassNotFoundException on tomcat startup)
body: <p>when I use an external tomcat everything is just fine. but I need to deploy my project on internal eclipse tomcat server in order to be able to use DCEVM class hot swapping.
  When I try to start tomcat server from within eclipse it says it is not able to find one of my service classes I mentioned in my spring security configuration file as a bean.
  I also tried to add the project to tomcat class path but it did not solve my problem.</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>I found out the problem is because when I deploy my web project to eclipse tomcat server, no .class is copied to: </p>
  
  <pre><code>C:\Users\Meysam\workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\villapweb\WEB-INF\classes
  </code></pre>
  
  <p>in fact, this folder contains my src/java/main package structure but no .class is copied in it.</p>
  
  <p>lib folder is fine though (e.g. all dependencies of maven and other stuff copies in the path it is supposed to)</p>
  
  <p>I think there might be something wrong with m2e-wtp plugin. I dont know what! </p>
  
  <p>I am using eclipse 4.3 BTW. </p>
  
  <p><strong>SOLVED</strong></p>
  
  <p>I Solved this issue following these steps:</p>
  
  <ol>
  <li>right click on project in eclipse > properties > project facets</li>
  <li>in the right panel select runtimes and select your target server. Apply and ok.</li>
  <li>in the server modules list right click on project module and click clean module work directory</li>
  <li>right click on the server itself and you can clean both server and tomcat work directory one after another</li>
  <li>if that didn't work, try project > clean and also toggle "build automatically" option under project menu item.</li>
  </ol>
  
  <p>Thats it. tomcat now copies all .class files to the target server and you see no ClassNotFound exception as tomcat starts up.</p>