IDEA报错ain] o.s.b.d.LoggingFailureAnalysisReporter :
详细描述
An attempt was made to call a method that does not exist. The attempt was made from the following location:
org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.isOverriddenByExistingDefinition(ConfigurationClassBeanDefinitionReader.java:304)
The following method did not exist:
org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader$ConfigurationClassBeanDefinition.setNonUniqueFactoryMethodName(Ljava/lang/String;)V
The method’s class, org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader$ConfigurationClassBeanDefinition, is available from the following locations:
jar:file:/C:/Users/CHENZHIWEI/.m2/repository/org/springframework/spring-context/5.2.9.RELEASE/spring-context-5.2.9.RELEASE.jar!/org/springframework/context/annotation/ConfigurationClassBeanDefinitionReader$ConfigurationClassBeanDefinition.class
The class hierarchy was loaded from the following locations:
org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.ConfigurationClassBeanDefinition: file:/C:/Users/CHENZHIWEI/.m2/repository/org/springframework/spring-context/5.2.9.RELEASE/spring-context-5.2.9.RELEASE.jar
org.springframework.beans.factory.support.RootBeanDefinition: file:/C:/Users/CHENZHIWEI/.m2/repository/org/springframework/spring-beans/5.1.3.RELEASE/spring-beans-5.1.3.RELEASE.jar
org.springframework.beans.factory.support.AbstractBeanDefinition: file:/C:/Users/CHENZHIWEI/.m2/repository/org/springframework/spring-beans/5.1.3.RELEASE/spring-beans-5.1.3.RELEASE.jar
org.springframework.beans.BeanMetadataAttributeAccessor: file:/C:/Users/CHENZHIWEI/.m2/repository/org/springframework/spring-beans/5.1.3.RELEASE/spring-beans-5.1.3.RELEASE.jar
org.springframework.core.AttributeAccessorSupport: file:/C:/Users/CHENZHIWEI/.m2/repository/org/springframework/spring-core/5.2.9.RELEASE/spring-core-5.2.9.RELEASE.jar
Action:
Correct the classpath of your application so that it contains a single, compatible version of org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader$ConfigurationClassBeanDefinition
Process finished with exit code 1
解决办法
在Application中将@SpringBootApplication修改成:
@SpringBootApplication(exclude={DataSourceAutoConfiguration.class)
若不行则
检查pom.xml
若添加了
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-beans</artifactId>
<version>5.1.3.RELEASE</version>
</dependency>
则为包冲突,将其删除即可
因为在创建Spring boot 工程的时候已经默认导入了最新的jar