Application run failed
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 'toCCustomerController' method

  出现此情况的 ,仔细观察当前controller 中的 requestMapping 中 是否存在相同url ,比如说不同方法名的请求路径相同

eg:

@PostMapping("/woxihuandabaitui")
public Object A(){ return ""; }

@PostMapping("/woxihuandabaitui")
public Object B(){ return ""; }

  

woxihuandabaitui 就是原因,Spring不允许映射中存在摸棱两可的requestMapping。改个名就好了,实际中也不可能存在一个类中俩一样的requestMapping,

如果有,那就是你new  bee

关于SpringBoot 启动失败 Invocation of init method failed; nested exception is java.lang.IllegalStateException: Ambiguous mapping. 的问题解析的更多相关文章

  1. MyBatis与Spring MVC结合时,使用DAO注入出现:Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Property 'sqlSessionFactory' or 'sqlSessionTemplate' are required

    错误源自使用了这个例子:http://www.yihaomen.com/article/java/336.htm,如果运行时会出现如下错误: Invocation of init method fai ...

  2. Invocation of init method failed; nested exception is java.text.ParseException: '?' can only be specfied for Day-of-Month or Day-of-Week.

    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'cronTrigger' ...

  3. springboot启动报错:Handler dispatch failed; nested exception is java.lang.AbstractMethodError

    最近在用springboot构建项目,控制台报错:Handler dispatch failed; nested exception is java.lang.AbstractMethodError, ...

  4. Invocation of init method failed; nested exception is org.hibernate.HibernateException: could not instantiate RegionFactory [org.hibernate.cache.impl

    严重: Exception sending context initialized event to listener instance of class org.springframework.we ...

  5. MyBatis笔记----报错:Error creating bean with name 'sqlSessionFactory' defined in class path resource [com/ij34/mybatis/applicationContext.xml]: Invocation of init method failed; nested exception is org.sp

    四月 05, 2017 4:51:02 下午 org.springframework.context.support.ClassPathXmlApplicationContext prepareRef ...

  6. Error creating bean with name 'sessionFactory' defined in class path resource [applicationContext.xml]: Invocation of init method failed; nested exception is org.hibernate.HibernateException: Unable t

    spring与hibernate整合然后出现如下错误: org.springframework.beans.factory.BeanCreationException: Error creating ...

  7. org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in class path resource [bean.xml]: Invocation of init method failed; nested exception is

    在复制xml文件进行修改的时候,我经常将不小心对原文件进行修改,而导致创建bean出错.报错如下所示: Exception sending context initialized event to l ...

  8. spring Boot启动报错Initialization of bean failed; nested exception is java.lang.NoSuchMethodError: org.springframework.core.annotation.AnnotatedElementUtils.getAnnotationAttributes

    spring boot 启动报错如下 org.springframework.context.ApplicationContextException: Unable to start web serv ...

  9. 项目启动时报错Instantiation of bean failed; nested exception is java.lang.ExceptionInInitializerError

    https://www.cnblogs.com/liuyp-ken/p/7911536.html 解决过程: 1.检查配置,反反复复看了很多遍,确认没有问题. 2. 网上找了很多资料,类似的问题很多, ...

  10. SpringBoot整合Elasticsearch启动报错处理 nested exception is java.lang.IllegalStateException: availableProcessors is already set to [8], rejecting [8]

    Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean wit ...

随机推荐

  1. mysql连接超时的属性设置

    mysql连接超时的属性设置 2022-10-26 11:09:54.128 [http-nio-6788-exec-5] ERROR o.s.t.i.TransactionAspectSupport ...

  2. mapperTemp

    @Insert("INSERT INTO coxisolate.instanceinfo (instance_id, app_name, create_time, update_time, ...

  3. 深入理解Android View(1)

    做android其实也有一段时间了,我们每个人都会碰到一些这样或那样的问题,碰到问题了就拼命百度,可是发现,我们解决问题的能力并没有提升很多,所以我才有想总结一下我项目中所用过的相关知识,并了解一下A ...

  4. metal invalid pixel format xx

    这个时候要考虑CAMetalLayer.pixelFormat是否设置设置正确,虽然MTLPixelFormat有很多枚举值,但是CAMetalLayer支持的也就只有五个: MTLPixelForm ...

  5. 华为交换机配置端口模式时报错:Please renew the default configurations

    场景 在华为交换机上使用混杂端口时报这个错,原因是你之前已经将此端口加入了某个vlan 所以你需要undo之前配置的命令 解决方法 sys int G 0/0/1 #替换为报错的端口 undo por ...

  6. QT学习:07 字符编码的问题

    --- title: framework-cpp-qt-07-字符编码的问题 EntryName: framework-cpp-qt-07-char-coding date: 2020-04-13 1 ...

  7. 【ClickHouse】0:clickhouse学习3之时间日期函数

    官方文档: https://clickhouse.tech/docs/zh/sql-reference/functions/date-time-functions/ 常用的clickhouse时间函数 ...

  8. 2023年台州市初赛Misc

    2023年台州市初赛Misc 这是神马 冰蝎流量,找到key <?php @error_reporting(0); session_start(); $key="144a6b22963 ...

  9. MySql 数据库、数据表操作

    数据库操作 创建数据库 语法 语法一:create database 数据库名 语法二:create database 数据库名 character set 字符集; 查看数据库 语法 查看数据库服务 ...

  10. LabVIEW的自定义按钮

    下载几张图片: 比较好的 网站1:https://www.iconfont.cn/ 网站2:https://yesicon.app/ 选用windows风格按钮控件进行自定义, 自定义的图片分别放入这 ...