1

My dispatcher-servlet file is

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:p="http://www.springframework.org/schema/p"
       xmlns:aop="http://www.springframework.org/schema/aop"
       xmlns:mvc="http://www.springframework.org/schema/mvc"
       xmlns:context="http://www.springframework.org/schema/context"
       xmlns:tx="http://www.springframework.org/schema/tx"
       xsi:schemaLocation="http://www.springframework.org/schema/beans     http://www.springframework.org/schema/beans/spring-beans-3.2.xsd
                          http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.2.xsd 
                          http://www.springframework.org/schema/context 

http://www.springframework.org/schema/context/spring-context-3.2.xsd 
                          http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.2.xsd 
                          http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.2.xsd">




 <context:component-scan base-package="com.controller"/>


     <mvc:annotation-driven/>


    <bean class="org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping

" />

    <bean class="org.springframework.web.servlet.mvc.support.ControllerClassNameHandlerMapping"/>

    <bean class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter" />

after running the application I found the error in server log is

class not found: "org.springframework.web.servlet.mvc.annotation. DefaultAnnotationHandlerMapping"

Someone said me to add appropriate jar files but I already added org.springframework.web.servlet-3.2.2.RELEASE.jar.

and I added all needed jar.

1
  • You might want to check spring-webmvc jar There is a starter application at tech.lalitbhatt.net/2014/08/…. Check the pom.xml. Commented Aug 31, 2014 at 9:20

1 Answer 1

1

Try replacing your bean class with- org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping

also remove <mvc:annotation-driven/> from your xml.

You need to do this if you have upgraded from spring 3.1.x to 3.2.x

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.