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)
The war gets deployed to tomcat 7 correctly.
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.
root cause
java.lang.NoClassDefFoundError: com/google/common/collect/ImmutableMap
first.model.BeerExpert.<clinit>(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.<clinit>(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)
is there any specific class path setting that needs to be done in the eclipse/tomcat
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.
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.