This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Spring and the fly likes How to Identify Cause of Context Initialization Failure Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "How to Identify Cause of Context Initialization Failure" Watch "How to Identify Cause of Context Initialization Failure" New topic
Author

How to Identify Cause of Context Initialization Failure

Dan King
Ranch Hand

Joined: Mar 18, 2009
Posts: 84
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

Joined: Oct 21, 2008
Posts: 180
can you show the error message stating that the context initialization failed ?


SCJP 5 , SCWCD 5, SCEA 5
Dan King
Ranch Hand

Joined: Mar 18, 2009
Posts: 84
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to Identify Cause of Context Initialization Failure
 
Similar Threads
Running application on web start
Transaction failure crashes program
Spring2.5.6+Tomcat7: HTTP Status 404: The requested resource () is not available
struts2.0 example console message
Anyone know what this Spring security error means?