title: maven + eclipse + tomcat : class not found exception
body: <p>I have a simple web app using that uses servlets. I created it as a maven project and then imported it into eclipse ( file ->import -> existing maven projects)</p>
  
  <p>The war gets deployed to tomcat 7 correctly.</p>
  
  <p>However when I create a tomcat 7 server in Eclipse and then start tomcat in eclipse I get an exception when I run the application.</p>
  
  <pre><code>root cause
  
  java.lang.NoClassDefFoundError: com/google/common/collect/ImmutableMap
      first.model.BeerExpert.&lt;clinit&gt;(BeerExpert.java:12)
      first.servlet.BeerServlet.doPost(BeerServlet.java:26)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:641)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
  root cause
  
  java.lang.ClassNotFoundException: com.google.common.collect.ImmutableMap
      org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1676)
      org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1521)
      first.model.BeerExpert.&lt;clinit&gt;(BeerExpert.java:12)
      first.servlet.BeerServlet.doPost(BeerServlet.java:26)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:641)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
  </code></pre>
  
  <p>is there any specific class path setting that needs to be done in the eclipse/tomcat</p>
  
  <p>Note: I am able to run mvn clean install and it creates the jar file. And then when I move the jar to a tomcat(7) webapp directory and restart it works just fine.</p>
  
  <p>I am not posting details of the pom.xml because the application itself is working fine. However id it is needed in resolution I can post it.</p>