Announcement Announcement Module
Collapse
No announcement yet.
Problem: infinite loop in DefaultListableBeanFactory. Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Problem: infinite loop in DefaultListableBeanFactory.

    Hi,

    I am stuck with the following problem: beans defined as children of a TransactionProxyFactoryBean are not being created just ones as expected, but multiple times.

    serviceContext.xml:

    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http&#58;//www.springframework.org/dtd/spring-beans.dtd">
    
    <beans>
    
    	<bean id="approvalManager" parent="managerBase">
    		<property name="target">
    			<bean
    				class="my.domain.tts.domain.manager.impl.ApprovalManagerImpl"
    				autowire="byType">
    			</bean>
    		</property>
    		<property name="proxyInterfaces">
    			<value>
    				my.domain.tts.domain.manager.IApprovalManager
    			</value>
    		</property>
    	</bean>
    
    	
    	<bean id="managerBase" abstract="true" 
    		class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean">
    		<property name="transactionManager">
    			<ref bean="transactionManager" />
    		</property>
    		<property name="transactionAttributes">
    			<props>
    				<prop key="get*">
    					PROPAGATION_REQUIRED,ISOLATION_READ_COMMITTED,readOnly
    				</prop>
    				<prop key="find*">
    					PROPAGATION_REQUIRED,ISOLATION_READ_COMMITTED,readOnly
    				</prop>
    				<prop key="load*">
    					PROPAGATION_REQUIRED,ISOLATION_READ_COMMITTED,readOnly
    				</prop>
    				<prop key="store*">
    					PROPAGATION_REQUIRED,ISOLATION_READ_COMMITTED
    				</prop>
    				<prop key="update*">
    					PROPAGATION_REQUIRED,ISOLATION_READ_COMMITTED
    				</prop>
    			</props>
    		</property>
    	</bean>
    
    </beans>
    To track the number of instances of the child bean being created, I added a static counter to the Constructor of the ApprovalManagerImpl class.

    The log shows that the ApprovalManagerImpl is being created many times, as if the application startup hangs in an infinite loop.

    This also happens to other beans (omitted here) defined as children of the TransactionProxyFactoryBean.

    I first was made aware of the problem when startup of the application context lead to my applications log filling up with these statements:

    2005-08-16 15:01:47,887 INFO [main] [] org.springframework.beans.factory.support.DefaultL istableBeanFactory - Creating shared instance of singleton bean 'approvalManager'
    Any help would be appreciated.

    Rgrds, Thomas

  • #2
    I has a circular reference in (other parts of) my application context - removing it solved this problem.

    Rgrds, Thomas

    Comment

    Working...
    X