-
Notifications
You must be signed in to change notification settings - Fork 38.8k
Description
David Gageot opened SPR-6354 and commented
The following code takes less than a second to run with version 3.0RC1. With 3.0RC2, it takes more than 30s.
The problem seems to come from the combination of SchedulerFactoryBean and lazy=true.
With lazy=false, everything is ok.
ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("applicationContext.xml");
Object bean = context.getBean("quartzScheduler");
context.destroy();
<bean id="quartzScheduler" class="org.springframework.scheduling.quartz.SchedulerFactoryBean" lazy-init="true" />
Here is the output log:
Nov 13, 2009 11:05:17 PM org.springframework.context.support.AbstractApplicationContext prepareRefresh
INFO: Refreshing org.springframework.context.support.ClassPathXmlApplicationContext@5265a77f: startup date [Fri Nov 13 23:05:17 CET 2009]; root of context hierarchy
Nov 13, 2009 11:05:17 PM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
INFO: Loading XML bean definitions from class path resource [applicationContext.xml]
Nov 13, 2009 11:05:18 PM org.springframework.beans.factory.support.DefaultListableBeanFactory preInstantiateSingletons
INFO: Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@8888e6c: defining beans [quartzScheduler]; root of factory hierarchy
Nov 13, 2009 11:05:18 PM org.quartz.core.SchedulerSignalerImpl <init>
INFO: Initialized Scheduler Signaller of type: class org.quartz.core.SchedulerSignalerImpl
Nov 13, 2009 11:05:18 PM org.quartz.core.QuartzScheduler <init>
INFO: Quartz Scheduler v.1.6.2 created.
Nov 13, 2009 11:05:18 PM org.quartz.simpl.RAMJobStore initialize
INFO: RAMJobStore initialized.
Nov 13, 2009 11:05:18 PM org.quartz.impl.StdSchedulerFactory instantiate
INFO: Quartz scheduler 'quartzScheduler' initialized from an externally provided properties instance.
Nov 13, 2009 11:05:18 PM org.quartz.impl.StdSchedulerFactory instantiate
INFO: Quartz scheduler version: 1.6.2
Nov 13, 2009 11:05:18 PM org.quartz.core.QuartzScheduler setJobFactory
INFO: JobFactory set to: org.springframework.scheduling.quartz.AdaptableJobFactory@49938039
Nov 13, 2009 11:05:18 PM org.springframework.context.support.AbstractApplicationContext doClose
INFO: Closing org.springframework.context.support.ClassPathXmlApplicationContext@5265a77f: startup date [Fri Nov 13 23:05:17 CET 2009]; root of context hierarchy
Nov 13, 2009 11:05:48 PM org.springframework.context.support.DefaultLifecycleProcessor$ShutdownGroup shutdown
WARNING: failed to shutdown beans with order 2147483647 within timeout of 30000
Nov 13, 2009 11:05:48 PM org.springframework.beans.factory.support.DefaultSingletonBeanRegistry destroySingletons
INFO: Destroying singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@8888e6c: defining beans [quartzScheduler]; root of factory hierarchy
Nov 13, 2009 11:05:48 PM org.springframework.scheduling.quartz.SchedulerFactoryBean destroy
INFO: Shutting down Quartz Scheduler
Nov 13, 2009 11:05:48 PM org.quartz.core.QuartzScheduler shutdown
INFO: Scheduler quartzScheduler_$_NON_CLUSTERED shutting down.
Nov 13, 2009 11:05:48 PM org.quartz.core.QuartzScheduler standby
INFO: Scheduler quartzScheduler_$_NON_CLUSTERED paused.
Nov 13, 2009 11:05:48 PM org.quartz.core.QuartzScheduler shutdown
INFO: Scheduler quartzScheduler_$_NON_CLUSTERED shutdown complete.
Affects: 3.0 RC2
Issue Links:
- Inconsistent handling of dependent lifecycle beans in DefaultLifecycleProcessor [SPR-16901] #21440 Inconsistent handling of dependent lifecycle beans in DefaultLifecycleProcessor
- Application context does not properly handle non-running SmartLifecyle beans [SPR-6572] #11238 Application context does not properly handle non-running SmartLifecyle beans
Referenced from: commits c6f3613