Spring异常Ambiguous mapping found.

SpringMVC启动时不停重复加载bean
通过浏览器访问获取异常:Error creating bean with name ‘org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping#0‘: Invocation of init method failed; nested exception is java.lang.IllegalStateException: Ambiguous mapping found. Cannot map ‘onlyOneRestController‘ bean method
重点截取:nested exception is java.lang.IllegalStateException: Ambiguous mapping found.

原因:Controller层同一请求

解决:查看报错地方,找出同一请求映射到两个方法的请求路径,修改后即可!

时间: 2024-10-06 16:12:39

Spring异常Ambiguous mapping found.的相关文章

java.lang.IllegalStateException: Ambiguous mapping found. Cannot map 'XXXXX' bean

今天启动srpingmvc项目的时候出现了这个异常, 原因: 在同个项目中,我复制了其中一个 Controller 作为备份 却忘记修改  @RequestMapping("/xxx") 在springmvc中不能同时映射一个名字(@RequestMapping("/xxx") java.lang.IllegalStateException: Ambiguous mapping found. Cannot map 'XXXXX' bean

Caused by: java.lang.IllegalStateException: Ambiguous mapping found

Caused by: java.lang.IllegalStateException: Ambiguous mapping found. Cannot map ‘myCockpitMgrController’ bean method 报错为:Caused by: java.lang.IllegalStateException: Ambiguous mapping found. Cannot map ‘myCockpitMgrController’ bean method 是因为两个请求,请求到同

spring异常记录-----java.lang.NoClassDefFoundError: org/apache/commons/lang3/StringUtils

今天在练习怎样SSH中进行单元測试的时候出现下列异常: SEVERE: Exception starting filter Struts2 java.lang.NoClassDefFoundError: org/apache/commons/lang3/StringUtils at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.register(XmlConfigurationProvider.java:211

spring异常错误信息---

在练习spring项目的过程中,出现了如下异常信息: Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory at org.springframework.context.support.AbstractApplicationContext.<init>(AbstractApplicationContext.java:145) at or

Ambiguous mapping found. Cannot map &#39;xxxxController&#39; bean method

1.背景 今天要做一个demo,从github上clone一个springmvc mybatis的工程(https://github.com/komamitsu/Spring-MVC-sample-using-iBatis) 打包成war后启动报错: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.web.servlet.mvc.

Hibernate整合Spring异常&#39;sessionFactory&#39; or &#39;hibernateTemplate&#39; is required

今日在写GenericDao时,发现了一个异常,内容如下: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'genericDao' defined in class path resource [spring.common.xml]: Invocation of init method failed; nested exception is java.lang.Ille

Ambiguous mapping found. Cannot map &#39;competeController&#39; bean method

报错: Error creating bean with name 'org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping#0': Invocation of init method failed; nested exception is java.lang.IllegalStateException: Ambiguous mapping found. Cannot map 'comp

(转)spring异常抛出触发事务回滚策略

背景:在面试时候问到事务方法在调用过程中出现异常,是否会传递的问题,平时接触的比较少,有些懵逼. spring异常抛出触发事务回滚策略 Spring.EJB的声明式事务默认情况下都是在抛出unchecked exception后才会触发事务的回滚 测试用业务逻辑方法: /** * 如果在spring事务配置中不为切入点(如这里的切入点可以定义成test*)配置事务在什么情况下回滚(格式:-引起回滚的异常类型) * 则spring默认只会在service方法抛出unchecked exceptio

spring异常被吞的一种情形

你是否遇到过下面的情况,控制台无限的输出下面的日志: Logging initialized using 'class org.apache.ibatis.logging.log4j.Log4jImpl' adapter. Logging initialized using 'class org.apache.ibatis.logging.log4j.Log4jImpl' adapter. Logging initialized using 'class org.apache.ibatis.lo