问题描述如下:<bean id="db" class="com.huawei.imuse.db.DBEx">
<property name="dataSource" ref="dataSource" />
<property name="jdbcTemplate" ref="jdbcTemplate" />
<property name="cfg" ref="cfg" />
</bean>
<bean id="cfg" class="com.huawei.insa2.util.Cfg" init-method="load" scope="singleton"
depends-on="db">
<property name="tableName" value="ManageConfig"></property>
</bean>
=============================
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'billDataDao' defined in URL [file:/home/mdmc/service/mdmc/mdmc.war/WEB-INF/model/system/spring/task/beijing-task.xml]: Cannot resolve reference to bean 'db_vac' while setting bean property 'db'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'db_vac' defined in URL [file:/home/mdmc/service/mdmc/mdmc.war/WEB-INF/model/system/spring/authenlog.xml]: Cannot resolve reference to bean 'cfg' while setting bean property 'cfg'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'db' defined in URL [file:/home/mdmc/service/mdmc/mdmc.war/WEB-INF/model/system/spring/springContext.xml]: Cannot resolve reference to bean 'cfg' while setting bean property 'cfg'; nested exception is org.springframework.beans.factory.BeanCurrentlyInCreationException: Error creating bean with name 'Singleton 'cfg' is already in creation': Requested bean is currently in creation: Is there an unresolvable circular reference?
Caused by:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'db_vac' defined in URL [file:/home/mdmc/service/mdmc/mdmc.war/WEB-INF/model/system/spring/authenlog.xml]: Cannot resolve reference to bean 'cfg' while setting bean property 'cfg'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'db' defined in URL [file:/home/mdmc/service/mdmc/mdmc.war/WEB-INF/model/system/spring/springContext.xml]: Cannot resolve reference to bean 'cfg' while setting bean property 'cfg'; nested exception is org.springframework.beans.factory.BeanCurrentlyInCreationException: Error creating bean with name 'Singleton 'cfg' is already in creation': Requested bean is currently in creation: Is there an unresolvable circular reference?
Caused by:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'db' defined in URL [file:/home/mdmc/service/mdmc/mdmc.war/WEB-INF/model/system/spring/springContext.xml]: Cannot resolve reference to bean 'cfg' while setting bean property 'cfg'; nested exception is org.springframework.beans.factory.BeanCurrentlyInCreationException: Error creating bean with name 'Singleton 'cfg' is already in creation': Requested bean is currently in creation: Is there an unresolvable circular reference?
Caused by:
org.springframework.beans.factory.BeanCurrentlyInCreationException: Error creating bean with name 'Singleton 'cfg' is already in creation': Requested bean is currently in creation: Is there an unresolvable circular reference?
把depends-on去掉就好了 谁能告诉我为什么Ps: 这个错误不是必现的,所以很纠结,自己想的理由也解释不通
<property name="dataSource" ref="dataSource" />
<property name="jdbcTemplate" ref="jdbcTemplate" />
<property name="cfg" ref="cfg" />
</bean>
<bean id="cfg" class="com.huawei.insa2.util.Cfg" init-method="load" scope="singleton"
depends-on="db">
<property name="tableName" value="ManageConfig"></property>
</bean>
=============================
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'billDataDao' defined in URL [file:/home/mdmc/service/mdmc/mdmc.war/WEB-INF/model/system/spring/task/beijing-task.xml]: Cannot resolve reference to bean 'db_vac' while setting bean property 'db'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'db_vac' defined in URL [file:/home/mdmc/service/mdmc/mdmc.war/WEB-INF/model/system/spring/authenlog.xml]: Cannot resolve reference to bean 'cfg' while setting bean property 'cfg'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'db' defined in URL [file:/home/mdmc/service/mdmc/mdmc.war/WEB-INF/model/system/spring/springContext.xml]: Cannot resolve reference to bean 'cfg' while setting bean property 'cfg'; nested exception is org.springframework.beans.factory.BeanCurrentlyInCreationException: Error creating bean with name 'Singleton 'cfg' is already in creation': Requested bean is currently in creation: Is there an unresolvable circular reference?
Caused by:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'db_vac' defined in URL [file:/home/mdmc/service/mdmc/mdmc.war/WEB-INF/model/system/spring/authenlog.xml]: Cannot resolve reference to bean 'cfg' while setting bean property 'cfg'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'db' defined in URL [file:/home/mdmc/service/mdmc/mdmc.war/WEB-INF/model/system/spring/springContext.xml]: Cannot resolve reference to bean 'cfg' while setting bean property 'cfg'; nested exception is org.springframework.beans.factory.BeanCurrentlyInCreationException: Error creating bean with name 'Singleton 'cfg' is already in creation': Requested bean is currently in creation: Is there an unresolvable circular reference?
Caused by:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'db' defined in URL [file:/home/mdmc/service/mdmc/mdmc.war/WEB-INF/model/system/spring/springContext.xml]: Cannot resolve reference to bean 'cfg' while setting bean property 'cfg'; nested exception is org.springframework.beans.factory.BeanCurrentlyInCreationException: Error creating bean with name 'Singleton 'cfg' is already in creation': Requested bean is currently in creation: Is there an unresolvable circular reference?
Caused by:
org.springframework.beans.factory.BeanCurrentlyInCreationException: Error creating bean with name 'Singleton 'cfg' is already in creation': Requested bean is currently in creation: Is there an unresolvable circular reference?
把depends-on去掉就好了 谁能告诉我为什么Ps: 这个错误不是必现的,所以很纠结,自己想的理由也解释不通
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货