idea报错 Error creating bean with name 'requestMappingHandlerMapping' defined in class path resource

核对一下控制器是不是写了相同的路径。。。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 ‘deliveryWeb‘ method
public java.lang.Object org.aodous.mall.toy.controller.DeliveryWeb.readyDelivery(org.aodous.mall.toy.pojo.DeliveryInfo)
to {[]}: There is already ‘deliveryWeb‘ bean method
public java.lang.Object org.aodous.mall.toy.controller.DeliveryWeb.cancelDelivery(org.aodous.mall.toy.pojo.CancelDeliveryInfo) mapped.
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1628) ~[spring-beans-4.3.13.RELEASE.jar:4.3.13.RELEASE]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:555) ~[spring-beans-4.3.13.RELEASE.jar:4.3.13.RELEASE]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483) ~[spring-beans-4.3.13.RELEASE.jar:4.3.13.RELEASE]
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306) ~[spring-beans-4.3.13.RELEASE.jar:4.3.13.RELEASE]
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) ~[spring-beans-4.3.13.RELEASE.jar:4.3.13.RELEASE]
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302) ~[spring-beans-4.3.13.RELEASE.jar:4.3.13.RELEASE]
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197) ~[spring-beans-4.3.13.RELEASE.jar:4.3.13.RELEASE]
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:761) ~[spring-beans-4.3.13.RELEASE.jar:4.3.13.RELEASE]
    at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:867) ~[spring-context-4.3.13.RELEASE.jar:4.3.13.RELEASE]
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:543) ~[spring-context-4.3.13.RELEASE.jar:4.3.13.RELEASE]
    at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:122) ~[spring-boot-1.5.9.RELEASE.jar:1.5.9.RELEASE]
    at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:693) [spring-boot-1.5.9.RELEASE.jar:1.5.9.RELEASE]
    at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:360) [spring-boot-1.5.9.RELEASE.jar:1.5.9.RELEASE]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:303) [spring-boot-1.5.9.RELEASE.jar:1.5.9.RELEASE]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1118) [spring-boot-1.5.9.RELEASE.jar:1.5.9.RELEASE]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1107) [spring-boot-1.5.9.RELEASE.jar:1.5.9.RELEASE]
    at org.aodous.mall.toy.ToyApplication.main(ToyApplication.java:12) [classes/:na]
Caused by: java.lang.IllegalStateException: Ambiguous mapping. Cannot map ‘deliveryWeb‘ method
public java.lang.Object org.aodous.mall.toy.controller.DeliveryWeb.readyDelivery(org.aodous.mall.toy.pojo.DeliveryInfo)
to {[]}: There is already ‘deliveryWeb‘ bean method
public java.lang.Object org.aodous.mall.toy.controller.DeliveryWeb.cancelDelivery(org.aodous.mall.toy.pojo.CancelDeliveryInfo) mapped.
    at org.springframework.web.servlet.handler.AbstractHandlerMethodMapping$MappingRegistry.assertUniqueMethodMapping(AbstractHandlerMethodMapping.java:576) ~[spring-webmvc-4.3.13.RELEASE.jar:4.3.13.RELEASE]
    at org.springframework.web.servlet.handler.AbstractHandlerMethodMapping$MappingRegistry.register(AbstractHandlerMethodMapping.java:540) ~[spring-webmvc-4.3.13.RELEASE.jar:4.3.13.RELEASE]
    at org.springframework.web.servlet.handler.AbstractHandlerMethodMapping.registerHandlerMethod(AbstractHandlerMethodMapping.java:264) ~[spring-webmvc-4.3.13.RELEASE.jar:4.3.13.RELEASE]
    at org.springframework.web.servlet.handler.AbstractHandlerMethodMapping.detectHandlerMethods(AbstractHandlerMethodMapping.java:250) ~[spring-webmvc-4.3.13.RELEASE.jar:4.3.13.RELEASE]
    at org.springframework.web.servlet.handler.AbstractHandlerMethodMapping.initHandlerMethods(AbstractHandlerMethodMapping.java:214) ~[spring-webmvc-4.3.13.RELEASE.jar:4.3.13.RELEASE]
    at org.springframework.web.servlet.handler.AbstractHandlerMethodMapping.afterPropertiesSet(AbstractHandlerMethodMapping.java:184) ~[spring-webmvc-4.3.13.RELEASE.jar:4.3.13.RELEASE]
    at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping.afterPropertiesSet(RequestMappingHandlerMapping.java:127) ~[spring-webmvc-4.3.13.RELEASE.jar:4.3.13.RELEASE]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1687) ~[spring-beans-4.3.13.RELEASE.jar:4.3.13.RELEASE]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1624) ~[spring-beans-4.3.13.RELEASE.jar:4.3.13.RELEASE]
    ... 16 common frames omitted

idea报错 Error creating bean with name 'requestMappingHandlerMapping' defined in class path resource

原文地址:https://www.cnblogs.com/sonder/p/9526258.html

时间: 2024-10-10 02:58:57

idea报错 Error creating bean with name 'requestMappingHandlerMapping' defined in class path resource的相关文章

java数据库执行迁移报错Error creating bean with name 'flywayInitializer' defined in class path resource

报错原因 org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'flywayInitializer' defined in class path resource [org/springframework/boot/autoconfigure/flyway/FlywayAutoConfiguration$FlywayConfiguration.class]: Invocati

Spring Boot 报错:Error creating bean with name 'entityManagerFactory' defined in class path resource

spring boot 写一个web项目,在使用spring-data-jpa的时候,启动报如下错误: Error starting ApplicationContext. To display the auto-configuration report re-run your application with 'debug' enabled.2018-04-02 17:00:47.076 ERROR 4648 --- [ main] o.s.boot.SpringApplication : A

【报错】org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'webSocketHandlerMapping' defined in class path resource

环境:maven+eclipse+jdk1.8 [tomcat使用的是maven自带的插件,实质原因就是出在tomcat版本问题] 背景:在进行SSM集成WebSocket的时候,项目启动报org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'webSocketHandlerMapping' defined in class path resource错误,详细如下 org.

Error creating bean with name 'sessionFactory' defined in class path resource [applicationContext.xm

报错信息如下: <span style="font-size:24px;">17:18:32,245 ERROR ContextLoader:307 - Context initialization failed org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in class path resour

Error creating bean with name &#39;entityManagerFactory&#39; defined in class path resource解决方案

? 项目是集成了Spring Boot和Spring Data,然后简单的把Spring Data Jpa和Spring Boot配置完成,开始进行公司项目的重构,然后出现了这个问题.当时也是找了挺多的资料,后来发现时javaBean的问题. 在Spring Data Jpa和实体类进行映射的时候,要特别注意实体类型和set.get方法名是否对应. Error starting ApplicationContext. To display the conditions report re-run

Error creating bean with name &#39;sessionFactory&#39; defined in class path resource [applicationContext.xml]: Invocation of init method failed; neste

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

Spring Boot - Error creating bean with name &#39;dataSource&#39; defined in class path resource

看起来像最初的问题是与自动配置. 如果你不需要数据源,只需从自动配置过程中删除它: @EnableAutoConfiguration(exclude={DataSourceAutoConfiguration.class}) Spring Boot - Error creating bean with name 'dataSource' defined in class path resource 原文地址:https://www.cnblogs.com/valu/p/8371296.html

SpringBoot Error creating bean with name &#39;dataSource&#39; defined in class path resource。。。

启动spring boot项目出错 解决方法在Application类上增加:@EnableAutoConfiguration(exclude={DataSourceAutoConfiguration.class}) 即 SpringBoot Error creating bean with name 'dataSource' defined in class path resource... 原文地址:https://www.cnblogs.com/hellokitty1/p/11169013

Spring Boot报错Error creating bean with name &#39;userRepository&#39;: Invocation of init method failed; nested exception

问题:出现UserRePository注入创建失败,一定先检查所有的@注解是否已经标记 问题发现:entity下的实体类上面没有加注解  任何基于hibernate的实体类一定要加上@Entity注解! Spring Boot报错Error creating bean with name 'userRepository': Invocation of init method failed; nested exception 原文地址:https://www.cnblogs.com/my-prog