出现org.springframework.boot.SpringApplication:771 - Application startup failed 问题的解决

本文记录了在使用IDEA启动Spring Boot项目时遇到的错误:因方法重名导致的启动失败问题。详细分析了错误原因,指出在@PostMapping注解下方法重名引发的异常,并提供了解决方案。

今天启动项目,idea用springb 启动的,出现了错误

ERROR 2019-01-26 15:33:46 [restartedMain] 

org.springframework.boot.SpringApplication:771 - Application startup failed
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean 

with name 'documentionPluginsBootstrapper' defined in URL [jar:file:/E:/maven-

repository/io/springfox/springfox-spring-web/2.7.0/springfox-spring-web-

2.7.0.jar!/springfox/documentation/spring/web/plugins/DocumentationPlunsBootstrapper

.class]: Unsatisfied dependency expressed through constructor parameter 1; nested 

exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error 

creating bean with name 'webMvRequeHandlerProvider' defined in URL 

[jar:file:/E:/maven-repository/io/springfox/springfox-spring-web/2.7.0/springfox-

spring-web-

2.7.0.jar!/springfox/documentation/spring/web/plugins/WebMvcuestHandlerProvider.cla

ss]: Unsatisfied dependency expressed through constructor parameter 0; nested 

exception is org.springframework.beans.factory.BeanCreationException: Error creating 

bean with name 'requestMingHandlerMapping' 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 



网上说是jar包冲突,这样的话可以去maven配置查看是否有冲突的相等jar包,但是我这个我一想刚才还是可以启动的,我写了一个方法就报错了,全局搜索后发现原来是

@PostMapping(XXX)

重名了,重写方法名,完毕。

ERROR 2025-07-25 13:51:42.114 172.18.18.95 org.springframework.boot.SpringApplication - Application startup failed org.springframework.beans.factory.BeanDefinitionStoreException: Failed to parse configuration class [com.viewhigh.vadp.framework.web.Application]; nested exception is org.springframework.context.annotation.ConflictingBeanDefinitionException: Annotation-specified bean name 'dynDesCore_ReceiptPoolBOImpl_bo' for bean class [com.viewhigh.oes.dyndes.dyndescore.bo.impl.ReceiptPoolBOImpl] conflicts with existing, non-compatible bean definition of same name and class [com.viewhigh.oes.custom.dyncustom.bo.impl.ReceiptPoolBOImpl] at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:183) at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:308) at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:228) at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanDefinitionRegistryPostProcessors(PostProcessorRegistrationDelegate.java:272) at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:92) at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:687) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:525) at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:122) at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:693) at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:360) at org.springframework.boot.SpringApplication.run(SpringApplication.java:303) at org.springframe
07-26
ERROR] 13:10:13.862 [main] o.s.boot.SpringApplication - Application startup failed org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'eventTraceHistoryController': Unsatisfied dependency expressed through field 'eventTraceHistoryService'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'eventTraceHistoryServiceImpl': Unsatisfied dependency expressed through field 'jobExecutionLogRepository'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jobExecutionLogRepository': Cannot create inner bean '(inner bean)#4088741b' of type [org.springframework.orm.jpa.SharedEntityManagerCreator] while setting bean property 'entityManager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '(inner bean)#4088741b': Cannot resolve reference to bean 'entityManagerFactory' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory': Post-processing of FactoryBean's singleton object failed; nested exception is <openjpa-3.1.2-r66d2a72 fatal general error> org.apache.openjpa.persistence.PersistenceException: Cannot load JDBC driver class 'com.mysql.jdbc.Driver' at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:586) at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:87) at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:364) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1268) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:551) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:481) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:312) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:308) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:756) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:867) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:542) at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:124) at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:693) at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:360) at org.springframework.boot.SpringApplication.run(SpringApplication.java:303) at org.springframework.boot.SpringApplication.run(SpringApplication.java:1118) at org.springframework.boot.SpringApplication.run(SpringApplication.java:1107)
最新发布
10-12
评论 1
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值