【@RequestMapping】 Cannot map 'groupController' method
来源:互联网 发布:windows查看进程命令 编辑:程序博客网 时间:2024/05/29 16:36
报错信息
:java.lang.IllegalStateException: Ambiguous mapping. Cannot map 'groupController' methodThere is already 'groupController' bean methodpublic com.platform.common.model.Result<java.lang.String> com.fxrj.sis.group.web.GroupController.saveGroup(com.fxrj.sis.group.model.Group,org.springframework.validation.BindingResult) mapped.org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'requestMappingHandlerMapping' defined in class path resource [org/springframework/boot/autoconfigure/web/WebMvcAutoConfiguration$EnableWebMvcConfiguration.class]: Invocation of init method failed; nested exception is java.lang.IllegalStateException: Ambiguous mapping. Cannot map 'groupController' method public com.platform.common.model.Result<java.lang.String> com.fxrj.sis.group.web.GroupController.deleteGroup(com.fxrj.sis.group.model.Group)
报错原因是:
我有两个@RequestMapping的Value没有配置;
*
因为Value是地址Path的别名,所以缺少了Value,Spring 的bean配不起来;
*
这里delete的@RequestMapping没有配置value地址;
这里的saveGroup没有配置Value;
因为Value默认的值是空值;
所以有两个@RequestMapping的Value都没有,这样系统都默认为空,这会导致冲突路径相同(都为空),所以才会报错;我注销了其中一个没有写Value的方法,果然,报错消失了;
所以,解决的办法是:
1.给没有Value的方法映射配置值,value即路径别名;
2.注销掉默认值都为空,或者value相同的映射;
阅读全文
1 0
- 【@RequestMapping】 Cannot map 'groupController' method
- Ambiguous mapping. Cannot map 'XXXXXController' method
- Cannot map 'XXXController.Create' bean method
- Ambiguous mapping found. Cannot map 'xx' method
- Ambiguous mapping. Cannot map 'XXXXXController' method
- Ambiguous mapping. Cannot map 'initController' method
- Ambiguous mapping found. Cannot map 'fancyController' bean method
- Ambiguous mapping found. Cannot map 'portalUserController' bean method
- Ambiguous mapping found. Cannot map 'xx' bean method异常
- 【错误积累】Ambiguous mapping found. Cannot map '***Controller' bean method
- Ambiguous mapping found. Cannot map 'complaintController' bean method
- Spring mvc Ambiguous mapping found. Cannot map controller bean method
- Java--- Ambiguous mapping. Cannot map "***Controller" been method解决办法
- Ambiguous mapping found. Cannot map 'xxxxController' bean method
- Ambiguous mapping. Cannot map "***Controller" been method解决办法
- SpringMVC“Ambiguous mapping found. Cannot map 'XXXController' bean method”解决方法
- 异常java.lang.IllegalStateException: Ambiguous mapping. Cannot map 'xxx' method
- @RequestMapping的params参数 @RequestMapping(params = "method=save")
- Linux tmux 参考手册
- 使用AndroidAnnotations时@AfterViews方法被调用两次的问题
- 堆排序
- Mysql安装若干事宜
- Application Server was not connected before run configuration stop, reason: Unable to ping server at
- 【@RequestMapping】 Cannot map 'groupController' method
- 调用admin/luke接口获取所有分词结果注意事项
- activity的启动模式
- Web前端需要掌握的知识
- Shiro 权限管理filterChainDefinitions过滤器配置
- ViewPager的滑动和滑动特效
- jquery和javascript的区别(常用方法比较)
- iOS
- iOS开发资料