tomcat - ClassNotFoundException , but class is available in maven dependency -
i stuck @ major situation. have class in maven dependancy , can referenced within class on running server displays classnotfoundexception.
thanks in advance
update:
environment:-
- eclipse juno.
- maven m2e plugin
- tomcat 7
i created maven project in eclipse , converted dynamic web project in facet changes - , added following in pom.xml , gave mvn eclipse:eclipse -dwtpversion=2.0
<dependency> <groupid>com.sun.jersey</groupid> <artifactid>jersey-server</artifactid> <version>1.8</version> </dependency>
this has downloaded available jars containing class com.sun.jersey.spi.container.servlet.servletcontainer
but on running server - java.lang.classnotfoundexception: com.sun.jersey.spi.container.servlet.servletcontainer
first suggest use latest version of eclipse (now 4.3 kepler) has m2e plugin built in , has much better support maven. you're no longer have add maven dependency project classpath manually.
try creating new maven project within eclipse, choose maven-archetype-webapp archetype. eclipse set including classpath maven depdencies.
whenever modify pom.xml, make sure classpath updated, though of cases done automatically m2e plugin. @ markers tab @ lower part of eclipse see if have such problems, if see "maven problem, project configurations not date", right click on project , choose maven->update projects.
Comments
Post a Comment