spring class not found when it exists

java, maven, servlets, spring, spring-mvc

Solution

If you are using eclipse, try clean project, and then clean Tomcat directory. Also make sure that maven dependencies are present in WEB-INF/lib, if not, this is configurable from Project Properties > Deployment Assembly

Problem

I'm getting an exception that "org.springframework.web.servlet.handler.BeanNameUrlHandlerMapping" does not exist in my WebContent\WEB-INF\spring-dispatcher-servlet.xml file. I have the spring-webmvc 4.1.2 dependency added and I the class exists in my maven dependencies so it's as though it isn't seeing those classes from my maven dependencies? ``` <bean id="HandlerMapping" class="org.springframework.web.servlet.handler.BeanNameUrlHandlerMapping" /> ```

Original source