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值重复造成
上一篇: Android仿PhotoShop调色板插件源代码下载
下一篇: swagger 报错 Ambiguous handler methods mapped for ‘/v3/api-docs/‘
推荐阅读
-
java.lang.IllegalStateException: Ambiguous handler methods mapped for HTTP path
-
swagger 报错 Ambiguous handler methods mapped for ‘/v3/api-docs/‘
-
报错处理:“Ambiguous handler methods mapped for ...”
-
Ambiguous handler methods mapped for HTTP path
-
Ambiguous handler methods mapped 模棱两可的方法
-
Ambiguous handler methods mapped for 'xxx'的解决办法
-
java.lang.IllegalStateException: Ambiguous handler methods mapped for ‘/emp/lisi‘: {public com.weiji