spring+quartz启动报错
如上代码和配置,启动tomcat报严重错误
2011-3-18 12:44:46 org.apache.catalina.core.StandardContext listenerStart
严重: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.scheduling.quartz.SchedulerFactoryBean#0' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested exception is org.quartz.SchedulerConfigException: Failure occured during job recovery. [See nested exception: org.quartz.JobPersistenceException: Failed to obtain DB connection from data source 'springNonTxDataSource.org.springframework.scheduling.quartz.SchedulerFactoryBean#0': java.sql.SQLException: org.logicalcobwebs.proxool.ProxoolException: Attempt to refer to a unregistered pool by its alias 'DBPool' [See nested exception: java.sql.SQLException: org.logicalcobwebs.proxool.ProxoolException: Attempt to refer to a unregistered pool by its alias 'DBPool']]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1420)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:563)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:895)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:425)
at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:276)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:197)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4681)
at org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5184)
at org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5179)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
Caused by: org.quartz.SchedulerConfigException: Failure occured during job recovery. [See nested exception: org.quartz.JobPersistenceException: Failed to obtain DB connection from data source 'springNonTxDataSource.org.springframework.scheduling.quartz.SchedulerFactoryBean#0': java.sql.SQLException: org.logicalcobwebs.proxool.ProxoolException: Attempt to refer to a unregistered pool by its alias 'DBPool' [See nested exception: java.sql.SQLException: org.logicalcobwebs.proxool.ProxoolException: Attempt to refer to a unregistered pool by its alias 'DBPool']]
at org.quartz.impl.jdbcjobstore.JobStoreSupport.initialize(JobStoreSupport.java:607)
at org.quartz.impl.jdbcjobstore.JobStoreCMT.initialize(JobStoreCMT.java:142)
at org.springframework.scheduling.quartz.LocalDataSourceJobStore.initialize(LocalDataSourceJobStore.java:151)
at org.quartz.impl.StdSchedulerFactory.instantiate(StdSchedulerFactory.java:1274)
at org.quartz.impl.StdSchedulerFactory.getScheduler(StdSchedulerFactory.java:1465)
at org.springframework.scheduling.quartz.SchedulerFactoryBean.createScheduler(SchedulerFactoryBean.java:600)
at org.springframework.scheduling.quartz.SchedulerFactoryBean.afterPropertiesSet(SchedulerFactoryBean.java:481)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1477)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1417)
... 20 more
Caused by: org.quartz.JobPersistenceException: Failed to obtain DB connection from data source 'springNonTxDataSource.org.springframework.scheduling.quartz.SchedulerFactoryBean#0': java.sql.SQLException: org.logicalcobwebs.proxool.ProxoolException: Attempt to refer to a unregistered pool by its alias 'DBPool' [See nested exception: java.sql.SQLException: org.logicalcobwebs.proxool.ProxoolException: Attempt to refer to a unregistered pool by its alias 'DBPool']
at org.quartz.impl.jdbcjobstore.JobStoreCMT.getNonManagedTXConnection(JobStoreCMT.java:165)
at org.quartz.impl.jdbcjobstore.JobStoreSupport.executeInNonManagedTXLock(JobStoreSupport.java:3753)
at org.quartz.impl.jdbcjobstore.JobStoreSupport.executeInNonManagedTXLock(JobStoreSupport.java:3725)
at org.quartz.impl.jdbcjobstore.JobStoreSupport.cleanVolatileTriggerAndJobs(JobStoreSupport.java:747)
at org.quartz.impl.jdbcjobstore.JobStoreSupport.initialize(JobStoreSupport.java:605)
... 28 more
Caused by: java.sql.SQLException: org.logicalcobwebs.proxool.ProxoolException: Attempt to refer to a unregistered pool by its alias 'DBPool'
at org.logicalcobwebs.proxool.ProxoolDriver.connect(ProxoolDriver.java:109)
at java.sql.DriverManager.getConnection(DriverManager.java:582)
at java.sql.DriverManager.getConnection(DriverManager.java:154)
at org.springframework.jdbc.datasource.DriverManagerDataSource.getConnectionFromDriverManager(DriverManagerDataSource.java:173)
at org.springframework.jdbc.datasource.DriverManagerDataSource.getConnectionFromDriver(DriverManagerDataSource.java:164)
at org.springframework.jdbc.datasource.AbstractDriverBasedDataSource.getConnectionFromDriver(AbstractDriverBasedDataSource.java:149)
at org.springframework.jdbc.datasource.AbstractDriverBasedDataSource.getConnection(AbstractDriverBasedDataSource.java:119)
at org.springframework.scheduling.quartz.LocalDataSourceJobStore$2.getConnection(LocalDataSourceJobStore.java:129)
at org.quartz.utils.DBConnectionManager.getConnection(DBConnectionManager.java:109)
at org.quartz.impl.jdbcjobstore.JobStoreCMT.getNonManagedTXConnection(JobStoreCMT.java:162)
... 32 more
2011-3-18 12:44:46 org.apache.catalina.core.StandardContext startInternal
严重: Error listenerStart
2011-3-18 12:44:46 org.apache.catalina.core.StandardContext startInternal
严重: Context [/webxxts] startup failed due to previous errors
2011-3-18 12:44:46 org.apache.catalina.core.ApplicationContext log
信息: Closing Spring root WebApplicationContext
2011-3-18 12:44:46 org.apache.catalina.loader.WebappClassLoader clearReferencesJdbc
严重: The web application [/webxxts] registered the JDBC driver [com.mysql.jdbc.Driver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered.
2011-3-18 12:44:46 org.apache.catalina.loader.WebappClassLoader clearReferencesJdbc
严重: The web application [/webxxts] registered the JDBC driver [org.logicalcobwebs.proxool.ProxoolDriver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered.
2011-3-18 12:44:46 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
严重: The web application [/webxxts] appears to have started a thread named [org.springframework.scheduling.quartz.SchedulerFactoryBean#0_Worker-1] but has failed to stop it. This is very likely to create a memory leak.
2011-3-18 12:44:46 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
严重: The web application [/webxxts] appears to have started a thread named [org.springframework.scheduling.quartz.SchedulerFactoryBean#0_Worker-2] but has failed to stop it. This is very likely to create a memory leak.
2011-3-18 12:44:46 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
严重: The web application [/webxxts] appears to have started a thread named [org.springframework.scheduling.quartz.SchedulerFactoryBean#0_Worker-3] but has failed to stop it. This is very likely to create a memory leak.
2011-3-18 12:44:46 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
严重: The web application [/webxxts] appears to have started a thread named [org.springframework.scheduling.quartz.SchedulerFactoryBean#0_Worker-4] but has failed to stop it. This is very likely to create a memory leak.
2011-3-18 12:44:46 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
严重: The web application [/webxxts] appears to have started a thread named [org.springframework.scheduling.quartz.SchedulerFactoryBean#0_Worker-5] but has failed to stop it. This is very likely to create a memory leak.
2011-3-18 12:44:46 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
严重: The web application [/webxxts] appears to have started a thread named [org.springframework.scheduling.quartz.SchedulerFactoryBean#0_Worker-6] but has failed to stop it. This is very likely to create a memory leak.
2011-3-18 12:44:46 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
严重: The web application [/webxxts] appears to have started a thread named [org.springframework.scheduling.quartz.SchedulerFactoryBean#0_Worker-7] but has failed to stop it. This is very likely to create a memory leak.
2011-3-18 12:44:46 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
严重: The web application [/webxxts] appears to have started a thread named [org.springframework.scheduling.quartz.SchedulerFactoryBean#0_Worker-8] but has failed to stop it. This is very likely to create a memory leak.
2011-3-18 12:44:46 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
严重: The web application [/webxxts] appears to have started a thread named [org.springframework.scheduling.quartz.SchedulerFactoryBean#0_Worker-9] but has failed to stop it. This is very likely to create a memory leak.
2011-3-18 12:44:46 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
严重: The web application [/webxxts] appears to have started a thread named [org.springframework.scheduling.quartz.SchedulerFactoryBean#0_Worker-10] but has failed to stop it. This is very likely to create a memory leak.
2011-3-18 12:44:46 org.apache.coyote.AbstractProtocolHandler start
信息: Starting ProtocolHandler ["http-apr-8080"]
2011-3-18 12:44:46 org.apache.catalina.startup.Catalina start
信息: Server startup in 4313 ms
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(9)
是哪里冲突呢 我也遇到同样的问题
估计是因为你的 dataSource 命名,spring自动吧这个dataSource注入到 quartz了
和哪些配置有冲突,麻烦交流一下,
rancococ@hotmail.com
搞定了,谢谢各位,和平常一样的操作
配置有冲突,启动起来了,不知道怎么操作库了???
package com.job;
public class MatchSmsOpenJob {
public void execute(){
System.out.println("do it...");
怎么操作数据库????
}
}
去掉最后的定时任务就正常
配置错,无法获取数据库连接
Failed to obtain DB connection from data source
package com.job;
public class MatchSmsOpenJob {
public void execute(){
System.out.println("do it...");
}
}