问题描述
使用quartz的时候,启动程序就抛出如下异常,不知道问题出在那,求解决...严重:Spring容器初始化过程中出现异常[wrzs_core]org.springframework.beans.factory.BeanCreationException:Errorcreatingbeanwithname'getScheduling':Invocationofinitmethodfailed;nestedexceptionisorg.quartz.SchedulerException:ThreadPoolclass'org.quartz.simpl.SimpleThreadPool'couldnotbeinstantiated.[Seenestedexception:java.lang.ClassCastException:org.quartz.simpl.SimpleThreadPool]atorg.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1338)atorg.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:473)atorg.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)atjava.security.AccessController.doPrivileged(NativeMethod)atorg.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)atorg.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)atorg.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)atorg.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)atorg.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)atorg.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)atorg.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:423)atorg.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:728)atorg.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:380)atorg.sotower.dm.spring.AppContextLoader$3.call(AppContextLoader.java:311)atorg.sotower.dm.spring.AppContextLoader$3.call(AppContextLoader.java:1)atjava.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:269)atjava.util.concurrent.FutureTask.run(FutureTask.java:123)atjava.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)atjava.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)atjava.lang.Thread.run(Thread.java:595)Causedby:org.quartz.SchedulerException:ThreadPoolclass'org.quartz.simpl.SimpleThreadPool'couldnotbeinstantiated.[Seenestedexception:java.lang.ClassCastException:org.quartz.simpl.SimpleThreadPool]atorg.quartz.impl.StdSchedulerFactory.instantiate(StdSchedulerFactory.java:768)atorg.quartz.impl.StdSchedulerFactory.getScheduler(StdSchedulerFactory.java:1371)atorg.springframework.scheduling.quartz.SchedulerFactoryBean.createScheduler(SchedulerFactoryBean.java:575)atorg.springframework.scheduling.quartz.SchedulerFactoryBean.afterPropertiesSet(SchedulerFactoryBean.java:451)atorg.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1369)atorg.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1335)...19moreCausedby:java.lang.ClassCastException:org.quartz.simpl.SimpleThreadPoolatorg.quartz.impl.StdSchedulerFactory.instantiate(StdSchedulerFactory.java:766)...24more2014-6-2510:46:11org.apache.catalina.core.ApplicationContextlog信息:应用系统全部加载完成
解决方案
解决方案二:
类型转换出错。Errorcreatingbeanwithname'getScheduling':Seenestedexception:java.lang.ClassCastException:org.quartz.simpl.SimpleThreadPool]