iis服务器助手广告广告
返回顶部
首页 > 资讯 > 后端开发 > JAVA >解决Caused by: java.lang.IllegalStateException: Ambiguous mapping. Cannot map ‘inteController‘
  • 846
分享到

解决Caused by: java.lang.IllegalStateException: Ambiguous mapping. Cannot map ‘inteController‘

java前端spring 2023-09-06 22:09:47 846人浏览 泡泡鱼
摘要

出现这个错也可能会出现项目无法启动的错误。完整错误是 org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'reque

出现这个错也可能会出现项目无法启动的错误。完整错误是

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'requestMappingHandlerMapping' defined in class path resource [org/springframework/boot/autoconfigure/WEB/servlet/WebmvcAutoConfiguration$EnableWebMvcConfiguration.class]: Invocation of init method failed; nested exception is java.lang.IllegalStateException: Ambiguous mapping. Cannot map 'recureController' method

一、错误出现原因

        controller层出现了重复的方法映射

        

        可以看到图片中两个方法的映射是一样的,这是问题所在

解决方法也很简单,既然已经知道了问题所在那么解决起来也很简单,只需要将重复的方法映射修改即可

二、另外,项目无法启动,一般存在配置错误。像我们常用的xml,或者是控制层的错误,在这里说几个常见的原因

1.        mapper.xml文件里出现了空的namespace路径(无法连接dao层)

2.        mapper.xml文件里有重复的方法名

3.        将resultMap和resultType写反(这里要明白两者的区别)

 

来源地址:https://blog.csdn.net/wiser_CC/article/details/130594110

--结束END--

本文标题: 解决Caused by: java.lang.IllegalStateException: Ambiguous mapping. Cannot map ‘inteController‘

本文链接: https://www.lsjlt.com/news/397629.html(转载时请注明来源链接)

有问题或投稿请发送至: 邮箱/279061341@qq.com    QQ/279061341

本篇文章演示代码以及资料文档资料下载

下载Word文档到电脑,方便收藏和打印~

下载Word文档
猜你喜欢
软考高级职称资格查询
编程网,编程工程师的家园,是目前国内优秀的开源技术社区之一,形成了由开源软件库、代码分享、资讯、协作翻译、讨论区和博客等几大频道内容,为IT开发者提供了一个发现、使用、并交流开源技术的平台。
  • 官方手机版

  • 微信公众号

  • 商务合作