This week's book giveaway is in the Design forum.
We're giving away four copies of Design for the Mind and have Victor S. Yocco on-line!
See this thread for details.
Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to Identify Cause of Context Initialization Failure

 
Dan King
Ranch Hand
Posts: 84
  • Mark post as helpful
  • send pies
  • 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.
 
ntumba lobo
Ranch Hand
Posts: 180
  • Mark post as helpful
  • send pies
  • 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
  • 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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic