今天遇到错误,搞了小半天
简单的例子
@Component
public class Person {
}
@Component("person")
public class Man{
}
报错
org.springframework.beans.factory.BeanDefinitionStoreException: Failed to parse configuration class [com.dfyang.TestApplication]; nested exception is org.springframework.context.annotation.ConflictingBeanDefinitionException: Annotation-specified bean name ‘person’ for bean class [com.dfyang.test.ConfigurationAndComponentAndBean.inter.impl.Person] conflicts with existing, non-compatible bean definition of same name and class [com.dfyang.test.ConfigurationAndComponentAndBean.inter.impl.Man]