4/07/2016

How to Resolve LifecycleProcessor not Initialized Error in Spring?

Spring based application we might have faced this issue, We could see server is started but application will not come up but in the logs we see following exceptions.








java.lang.IllegalStateException: LifecycleProcessor not initialized - call 'refresh' before invoking lifecycle methods via the context: Root WebApplicationContext: startup date [Fri Aug 07 17:01:02 IST 2015]; root of context hierarchy
 at org.springframework.context.support.AbstractApplicationContext.getLifecycleProcessor(AbstractApplicationContext.java:360)
 at org.springframework.context.support.AbstractApplicationContext.doClose(AbstractApplicationContext.java:1059)
 at org.springframework.context.support.AbstractApplicationContext.close(AbstractApplicationContext.java:1012)
 at org.springframework.web.context.ContextLoader.closeWebApplicationContext(ContextLoader.java:586)
 at org.springframework.web.context.ContextLoaderListener.contextDestroyed(ContextLoaderListener.java:143)
 at org.apache.catalina.core.StandardContext.listenerStop(StandardContext.java:4927)
 at org.apache.catalina.core.StandardContext.stopInternal(StandardContext.java:5573)
 at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:232)
 at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:160)
 at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
 at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
 at java.util.concurrent.FutureTask.run(Unknown Source)
 at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
 at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
 at java.lang.Thread.run(Unknown Source)

Possible Reasons:
 1.This error signifies spring context is not yet started.
2. This is generic error we get when ever spring context is not started and check the server logs to see more information about the failures.
3. Please make sure that your tomcat work directory is cleaned because some times in proper publishing of resources may leading to this error.

CommentsComments