title: ClassNotFoundException when running a Spring + Maven2 project on Tomcat 6 from within Eclipse 3.5
body: <p>When trying to launch a Web project from within Eclipse I get:</p>
  
  <pre><code>
  SEVERE: Error configuring application listener of class org.springframework.web.context.ContextLoaderListener
  java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener
      at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1387)
      at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1233)
      at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3877)
      at org.apache.catalina.core.StandardContext.start(StandardContext.java:4429)
      at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
      at org.apache.catalina.core.StandardHost.start(StandardHost.java:722)
      at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
      at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
      at org.apache.catalina.core.StandardService.start(StandardService.java:516)
      at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
      at org.apache.catalina.startup.Catalina.start(Catalina.java:583)
      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:597)
      at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
      at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
  </code></pre>
  
  <p>Project started to fail when I switched to Fedora 12 x64. The project worked on WinXP with same configuration.</p>
  
  <p>Googling around I found posts claiming that going to <em>Project Properties -> Java EE Module Dependencies</em> and checking the <em>Maven Dependencies</em> box fixes the issue. Sadly it didn't worked for me.</p>
  
  <p>I'm using Spring 2.5.6, Maven2, Eclipse 3.5 (with the m2e 0.10.0 plugin), Tomcat 6 and Java 6 running on Fedora 12 x64.</p>
  
  <p>Has anyone seen this problem?</p>
  
  <p>In case it helps here is my .classpath file</p>
  
  <pre><code>
  &lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;classpath&gt;
      &lt;classpathentry kind="src" output="target/classes" path="src/main/java"/&gt;
      &lt;classpathentry kind="src" output="target/classes" path="target/generated-sources/gpb"/&gt;
      &lt;classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources"/&gt;
      &lt;classpathentry kind="src" output="target/test-classes" path="src/test/java"/&gt;
  
      &lt;classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/&gt;
  
      &lt;classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"&gt;
          &lt;attributes&gt;
              &lt;attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/&gt;
          &lt;/attributes&gt;
      &lt;/classpathentry&gt;
      &lt;classpathentry kind="con" path="org.eclipse.iam.jdt.core.mavenClasspathContainer"&gt;
          &lt;attributes&gt;
              &lt;attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/&gt;
          &lt;/attributes&gt;
      &lt;/classpathentry&gt;
      &lt;classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.web.container"/&gt;
      &lt;classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.module.container"/&gt;
      &lt;classpathentry kind="output" path="target/classes"/&gt;
  &lt;/classpath&gt;
  </code></pre>
  
  <p><b>Update:</b> I don't have any problems building or running the project outside Eclipse.</p>