Here our controller class should extends

import org.springframework.web.servlet.mvc.AbstractController;

public class AppController extends AbstractController{ }

Here we need to implement the abstract method as :

protected modelandview handleRequestInternal(HttpServletRequest arg0, HttpServletResponse arg1) throws Exception { return null; }


Make sure you have implemented Controller in your controller classes and overrided handleRequest method.


Try adding the following as a handler mapper(Worked for me):

<bean id="HandlerMapping" class="org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping"/>


This problem occurred for me when I tried to define RestController path by using in this way:

public class TestController {}

In the above section, the meaning of this declaration is different. Here actually "/test" is defined as bean name rather than path for the controller.

After defining the path in this way it worked for me:

public class TestController {}


I resolved the issue. I forgot to add the @Controller annotation in controller class. There are fore we can use the both methods(annotation mapping & XML mapping) together in an application.


This error also occurs when you define a restController but forget to define the requestMapping.

@RequestMapping("/api/orders") // <---- dont't forget the requestMapping

Related Query

More Query from same tag