title: Why is Spring Container Destroying Beans Immediately After Creating Them?
body: <p>Immediately after creating all the beans declared in the various context files of my application, Spring notifies (see below) that it is destroying singletons and that context initialization failed.</p>
  
  <blockquote>
    <p>[INFO] Destroying singletons in
    org.springframework.beans.factory.support.DefaultListableBeanFactory
    org.springframework.web.context.ContextLoader [ERROR] Context
    initialization failed</p>
  </blockquote>
  
  <p>Does anyone know why the Spring container is destroying all the beans right after creating them?</p>
  
  <p>NOTE: There are no warnings or errors in the log output aside from the above context initialization failure error -- see below.</p>
  
  <blockquote>
    <p>[DEBUG] Eagerly caching bean 'uploadService' to allow for resolving potential circular references 
    2011-09-21 15:19:08 org.springframework.beans.factory.annotation.InjectionMetadata </p>
    
    <p>[DEBUG] Processing injected method of bean 'uploadService': AutowiredFieldElement for private
    org.apache.commons.fileupload.disk.DiskFileItemFactory com.faciler.ws.services.UploadService.diskFileFactory 2011-09-21 15:19:08
    org.springframework.beans.factory.support.DefaultListableBeanFactory </p>
    
    <p>[DEBUG] Creating shared instance of singleton bean
    'diskFileItemFactory' 2011-09-21 15:19:08
    org.springframework.beans.factory.support.DefaultListableBeanFactory </p>
    
    <p>[DEBUG] Creating instance of bean 'diskFileItemFactory' 2011-09-21
    15:19:08
    org.springframework.beans.factory.support.DefaultListableBeanFactory </p>
    
    <p>[INFO] Destroying singletons in
    org.springframework.beans.factory.support.DefaultListableBeanFactory@b0ede6:
    defining beans [org.springframework.beans.</p>
  </blockquote>