标签:reflect sam str 一个 access name lap counter nis
WARNING: Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanDefinitionStoreException: Invalid bean definition with name ‘configure‘ defined in com.jing.spring.annotation.Configure: factory-bean reference points back to the same bean definition org.springframework.beans.factory.BeanDefinitionStoreException: Invalid bean definition with name ‘configure‘ defined in com.jing.spring.annotation.Configure: factory-bean reference points back to the same bean definition at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.getTypeForFactoryMethod(AbstractAutowireCapableBeanFactory.java:673) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.determineTargetType(AbstractAutowireCapableBeanFactory.java:638) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.predictBeanType(AbstractAutowireCapableBeanFactory.java:607) at org.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean(AbstractBeanFactory.java:1486) at org.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean(AbstractBeanFactory.java:1009) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:741) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:867) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:543) at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:139) at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:83) at com.jing.spring.ioc.UnitTestBase.before(UnitTestBase.java:33) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
package com.jing.spring.annotation; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; @Configuration public class Configure { @Bean(name = {"configure","configure1"}) public BeanConfigureI beanCon(){ return new BeanConfigureImpl(); } }
package com.jing.spring.annotation; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; @Configuration public class Configure { @Bean(name = {"configure2","configure1"}) public BeanConfigureI beanCon(){ return new BeanConfigureImpl(); } }
Spring错误——Spring 注解——factory-bean reference points back to the same bean definition
标签:reflect sam str 一个 access name lap counter nis
原文地址:https://www.cnblogs.com/jixue/p/10431473.html