我的程序中有一个循环引用。我认为我的程序没有问题。它可以在windows
上运行。当我将其放在linux
上时,将导致异常。
下面是错误日志:
org.springframework.beans.factory.BeanCurrentlyInCreationException: Error creating bean with name 'customGroupDataManager':
Requested bean is currently in creation: Is there an unresolvable circular reference?`
下面是我的代码:
<bean id="customUserDataManager" lazy-init="true" class="com.hand.hap.activiti.manager.CustomUserDataManager">
<constructor-arg ref="processEngineConfiguration"/>
</bean>
<bean id="customBehaviorFactory" class="com.hand.hap.activiti.custom.CustomBehaviorFactory"/>
<bean id="activitiBeanProvider" class="com.hand.hap.activiti.custom.ActivitiBeanProvider"/>
<bean id="notificationListener" class="com.hand.hap.activiti.listeners.NotificationListener"/>
<bean id="processEngineConfiguration" class="org.activiti.spring.SpringProcessEngineConfiguration">
<property name="dataSource" ref="dataSource"/>
<property name="transactionManager" ref="transactionManager"/>
<property name="databaseSchemaUpdate" value="true"/>
<property name="mailServerHost" value="smtp.126.com"/>
<property name="mailServerPort" value="25"/>
<property name="mailServerUsername" value="[email protected]"/>
<property name="mailServerPassword" value="hapdev11"/>
<property name="asyncExecutorActivate" value="true"/>
<property name="dbIdentityUsed" value="false"/>
<property name="activityBehaviorFactory" ref="customBehaviorFactory"/>
<property name="groupDataManager" ref="customGroupDataManager"/>
<property name="userDataManager" ref="customUserDataManager"/>
<property name="beans" ref="activitiBeanProvider"/>
<property name="customDefaultBpmnParseHandlers" >
<list>
<bean class="com.hand.hap.activiti.custom.AddListenerUserTaskParseHandler">
<constructor-arg index="0" value="create"/>
<constructor-arg index="1" ref="notificationListener"/>
</bean>
</list>
</property>
</bean>
最佳答案
是的,有:
customUserDataManager需要processEngineConfiguration,后者需要customUserDataManager,并且圆圈开始。