title: Eclipse Maven Spring: Server Error when I try to Run As Server (Tomcat 7)
body: <p>I have a Java project using the <strong>Spring MVC</strong> framework and <strong>Maven</strong> as its build system. The primary IDE I wish to use is <strong>Eclipse for Java EE</strong>. I am using a standard Maven project structure for my application: source code is in <code>src/main/java</code>, resources for the application are in <code>src/main/resources</code> and code related to the web container are in <code>src/main/webapp</code>. In <code>src/main/webapp/WEB-INF</code>, I have a <code>web.xml</code> file for configuring my server and multiple folders for Spring-related files, such as context XML files and views. These Spring files are linked to legally in web.xml.</p>
  
  <p>When I try to run the project using the <em>Maven-Tomcat7-Plugin</em> (via the <code>mvn tomcat7:run-war</code> goal), my project launches successfully and I am able to view my web pages and see my REST controller in action without issue.</p>
  
  <p>However, when I try to run the project in Eclipse, using its <code>Run As Server</code> option, it never works and I have no idea why not. I keep getting an error dialog box titles <strong>Server Error</strong> and with the message <strong>The selection cannot be run on any server.</strong> I have already configured a <strong>Tomcat 7</strong> server runtime legally in Eclipse; I can use this runtime without any problem for my other Java projects. I have tried everything that Google, Stackoverflow and blogs suggest to get an Eclipse Maven Spring project working on an Eclipse server. I've tried to delete the Eclipse project, delete the Eclipse-workspace files and reimport the project (both as a Maven project and as a regular Java project), but to no avail. I've also tried enabling the Dynamic Web Module in the <em>Project Facets</em> and setting the web directory to <code>src/main/webapp</code>, but also to no avail.</p>
  
  <p>I'm baffled; I've worked with Tomcat servers in Eclipse many times before but it is just not working for this specific Spring project, <strong>even though</strong> it deploys just fine on Tomcat using Maven. Does anyone have any idea what might be going wrong? Have I forgotten a trouble-shooting step? Is there something wrong with my project setup that is conflicting with what Eclipse expects in a Web Server project? Thanks in advance.</p>