No mapping found for HTTP request with URI in DispatcherServlet with name 'dispatcher'


I am  getting an error while running the application, I am using jboss 7.1

what is the issue

11:27:13,409 WARN  [org.springframework.web.servlet.PageNotFound] (http-localhost- No mapping found for HTTP request with URI [/SpringExample11/userRegistration.htm] in DispatcherServlet with name 'dispatcher'

Here is my web.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="" xmlns="" xmlns:web="" xsi:schemaLocation="" id="WebApp_ID" version="2.5">

Open in new window

 <?xml version="1.0" encoding="UTF-8" ?> 
- <beans xmlns="" xmlns:xsi="" xmlns:p="" xmlns:context="" xsi:schemaLocation="">
  <bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver" p:prefix="/WEB-INF/jsp/" p:suffix=".jsp" /> 
  <bean id="userService" class="com.vaannila.service.UserServiceImpl" /> 
  <context:component-scan base-package="com.vaannila.web" /> 
  <bean class="org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping" /> 
  <bean class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter" /> 

Open in new window

Who is Participating?
roy_sanuConnect With a Mentor Author Commented:
Added BeanNameUrlHandlerMapping it is working fine...............
	<bean class="org.springframework.web.servlet.handler.BeanNameUrlHandlerMapping"/>

		<bean name="/userRegistration.htm" class="com.vaannila.web.UserController" />
	<bean name="/userSuccess.htm" class="com.vaannila.web.UserSuccessController" />

Open in new window

chaitu chaituCommented:
check whether userRegistration.htm exists or not in SpringExample11.war directory.
roy_sanuAuthor Commented:
it is working tomcat 7 but not with Jboss 7, what might be the reason
Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

mccarlIT Business Systems Analyst / Software DeveloperCommented:
I think the difference between Tomcat and JBoss is in the way the app is getting deployed. If this is the url that you are currently using...


...then try the following instead...


If this isn't the problem, then can you please post the code for your Spring controller class?
roy_sanuAuthor Commented:
No, it is not working with the above url, same error

Here is the piece of controller code...........
public class UserController {

	private UserService userService;

	public void setUserService(UserService userService) {
		this.userService = userService;
	@RequestMapping(method = RequestMethod.GET)
	public String showUserForm(ModelMap model)
		User user = new User();
		return "userForm";

	@RequestMapping(method = RequestMethod.POST)
	public String onSubmit(@ModelAttribute("user") User user) {
		return "redirect:userSuccess.htm";

Open in new window

mccarlIT Business Systems Analyst / Software DeveloperCommented:
Can you post the full logs, including before the error message. Spring should have logged what controllers it found and their request mappings which should help debug why it can't find this one.
roy_sanuAuthor Commented:
22:50:41,455 INFO  [] (MSC service thread 1-7) JBAS015874: JBoss AS 7.1.1.Final "Brontes" started in 125162ms - Started 222 of 299 service
s (76 services are passive or on-demand)
22:50:42,105 INFO  [] (DeploymentScanner-threads - 2) JBAS018559: Deployed "SpringExample11.war"
23:01:36,891 WARN  [org.springframework.web.servlet.PageNotFound] (http-- No mapping found for HTTP request with URI [/SpringExample1
1/userRegistration.htm] in DispatcherServlet with name 'dispatcher'
23:01:57,812 WARN  [org.springframework.web.servlet.PageNotFound] (http-- No mapping found for HTTP request with URI [/SpringExample1
1/userRegistration.htm] in DispatcherServlet with name 'dispatcher'

Open in new window

In the redirect.jsp page

%@page contentType="text/html" pageEncoding="UTF-8"%>
<% response.sendRedirect("userRegistration.htm"); %>

Open in new window

roy_sanuAuthor Commented:
This is working fine now..........
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.