• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Liutauras Vilda
  • Paul Clapham
Sheriffs:
  • paul wheaton
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Piet Souris
Bartenders:
  • Mike London

How to Identify Cause of Context Initialization Failure

 
Ranch Hand
Posts: 84
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
When I deploy my application war file to tomcat, the log files indicate that spring creates and injects the beans declared in the various context files of my application. However, once all the beans are created the Spring container destroys all the beans and then throws an error stating context initialization failed. I've set the logging level of Spring to debug, but there is nothing in the log files that indicate what is causing the Spring container to destroy all beans and shutdown. Anyone have any suggestions on how I can determine the root of the problem? Thanks.

Below are the messages I get right before I'm notified that Spring will destroy all the beans:


[DEBUG] Eagerly caching bean 'uploadService' to allow for resolving potential circular references
2011-09-21 15:19:08 org.springframework.beans.factory.annotation.InjectionMetadata
[DEBUG] Processing injected method of bean 'uploadService': AutowiredFieldElement for private org.apache.commons.fileupload.disk.DiskFileItemFactory com.mass.ws.services.UploadService.diskFileFactory
2011-09-21 15:19:08 org.springframework.beans.factory.support.DefaultListableBeanFactory
[DEBUG] Creating shared instance of singleton bean 'diskFileItemFactory'
2011-09-21 15:19:08 org.springframework.beans.factory.support.DefaultListableBeanFactory
[DEBUG] Creating instance of bean 'diskFileItemFactory'
2011-09-21 15:19:08 org.springframework.beans.factory.support.DefaultListableBeanFactory
[INFO] Destroying singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@b0ede6: defining beans [org.springframework.beans.

 
Ranch Hand
Posts: 180
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
can you show the error message stating that the context initialization failed ?
 
Dan King
Ranch Hand
Posts: 84
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

ntumba lobo wrote:can you show the error message stating that the context initialization failed ?



The message is below:


2011-09-21 15:52:05 org.springframework.beans.factory.support.DisposableBeanAdapter
[DEBUG] Invoking destroy() on bean with name 'entityManagerFactory'
2011-09-21 15:52:05 org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean
[INFO] Closing JPA EntityManagerFactory for persistence unit 'regulation'
2011-09-21 15:52:05 org.springframework.beans.factory.support.DefaultListableBeanFactory
[DEBUG] Retrieved dependent beans for bean 'org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter#b80f1c': [entityManagerFactory]
2011-09-21 15:52:05 org.springframework.web.context.ContextLoader
[ERROR] Context initialization failed

 
reply
    Bookmark Topic Watch Topic
  • New Topic