欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

java.lang.IllegalStateException: Ambiguous handler methods mapped for HTTP path

程序员文章站 2022-03-01 13:38:08
...

异常信息
服务器500错误

org.springframework.web.util.NestedServletException: Request processing failed; nested exception is java.lang.IllegalStateException: Ambiguous handler methods mapped for HTTP path 'http://localhost:8080/SSM/emps/1': {public java.lang.String com.joker.ssm.controller.EmpController.getAllEmp(java.util.Map,java.lang.Integer,javax.servlet.http.HttpServletRequest), public java.lang.String com.joker.ssm.controller.EmpController.toUpdate(java.lang.String,java.util.Map)}
	org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:943)
	org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:822)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:635)
	org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:807)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:742)
	org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
	org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:77)
	org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:108)
	org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
	org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:108)
Root Cause

java.lang.IllegalStateException: Ambiguous handler methods mapped for HTTP path 'http://localhost:8080/SSM/emps/1': {public java.lang.String com.joker.ssm.controller.EmpController.getAllEmp(java.util.Map,java.lang.Integer,javax.servlet.http.HttpServletRequest), public java.lang.String com.joker.ssm.controller.EmpController.toUpdate(java.lang.String,java.util.Map)}
	org.springframework.web.servlet.handler.AbstractHandlerMethodMapping.lookupHandlerMethod(AbstractHandlerMethodMapping.java:276)
	org.springframework.web.servlet.handler.AbstractHandlerMethodMapping.getHandlerInternal(AbstractHandlerMethodMapping.java:225)
	org.springframework.web.servlet.handler.AbstractHandlerMethodMapping.getHandlerInternal(AbstractHandlerMethodMapping.java:56)
	org.springframework.web.servlet.handler.AbstractHandlerMapping.getHandler(AbstractHandlerMapping.java:300)
	org.springframework.web.servlet.DispatcherServlet.getHandler(DispatcherServlet.java:1101)
	org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:916)
	org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:876)
	org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:931)
	org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:822)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:635)
	org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:807)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:742)
	org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
	org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:77)
	org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:108)
	org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
	org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:108)
分析:
	业务场景:ssm整合项目
	解决:
		由于controller层@RequestMapping中的value的url值重复造成
相关标签: Weirdo Exception