@ -1007,11 +1007,16 @@ public abstract class AbstractApplicationContext extends DefaultResourceLoader
@@ -1007,11 +1007,16 @@ public abstract class AbstractApplicationContext extends DefaultResourceLoader
publishEvent(newContextClosedEvent(this));
}
catch(Throwableex){
logger.error("Exception thrown from ApplicationListener handling ContextClosedEvent",ex);
logger.warn("Exception thrown from ApplicationListener handling ContextClosedEvent",ex);
}
// Stop all Lifecycle beans, to avoid delays during individual destruction.
getLifecycleProcessor().onClose();
try{
getLifecycleProcessor().onClose();
}
catch(Throwableex){
logger.warn("Exception thrown from LifecycleProcessor on context close",ex);
}
// Destroy all cached singletons in the context's BeanFactory.
@ -161,7 +162,12 @@ public class DefaultLifecycleProcessor implements LifecycleProcessor, BeanFactor
@@ -161,7 +162,12 @@ public class DefaultLifecycleProcessor implements LifecycleProcessor, BeanFactor
if(logger.isDebugEnabled()){
logger.debug("Starting bean '"+beanName+"' of type ["+bean.getClass()+"]");
}
bean.start();
try{
bean.start();
}
catch(Throwableex){
thrownewApplicationContextException("Failed to start bean '"+beanName+"'",ex);
}
if(logger.isDebugEnabled()){
logger.debug("Successfully started bean '"+beanName+"'");