Results 1 to 2 of 2

Thread: Problem: infinite loop in DefaultListableBeanFactory.

  1. #1
    Join Date
    Oct 2004
    Location
    Rotterdam, Netherlands
    Posts
    90

    Default 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. #2
    Join Date
    Oct 2004
    Location
    Rotterdam, Netherlands
    Posts
    90

    Default

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

    Rgrds, Thomas

Similar Threads

  1. CAS & acegi goes into infinite loop
    By blackjet in forum Security
    Replies: 5
    Last Post: Sep 25th, 2007, 10:11 AM
  2. Replies: 3
    Last Post: Jul 18th, 2005, 04:22 AM
  3. Replies: 1
    Last Post: Jul 5th, 2005, 03:48 AM
  4. pagination and continuation problem in SWF
    By yfmoan in forum Web Flow
    Replies: 6
    Last Post: Jun 29th, 2005, 03:42 AM
  5. Replies: 9
    Last Post: Apr 19th, 2005, 11:05 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •