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" />
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
You probably have multiple versions of spring-webmvc
on your classpath as dependencies of other direct dependency. Call mvn dependency:tree -Dverbose -Dincludes=spring-webmvc
to see how many versions of the library you have and exclude older versions.
Or, if you are using Intellij, enable the maven plug-in, generate diagram, search with Ctrl-F for spring-webmvc
and where you have older dependency right click on it and choose exclude
. Probably eclipse has similar functionality too.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With