spring+quartz启动报错

发布于 2021-11-22 08:41:54 字数 11613 浏览 853 评论 9

如上代码和配置,启动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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(9

北笙凉宸 2021-11-25 22:27:08

是哪里冲突呢  我也遇到同样的问题

冬天旳寂寞 2021-11-25 22:26:58

估计是因为你的 dataSource 命名,spring自动吧这个dataSource注入到 quartz了

哑剧 2021-11-25 22:25:51

和哪些配置有冲突,麻烦交流一下,
rancococ@hotmail.com

夜司空 2021-11-25 22:25:24

搞定了,谢谢各位,和平常一样的操作

风苍溪 2021-11-25 22:19:13

配置有冲突,启动起来了,不知道怎么操作库了???

网名女生简单气质 2021-11-25 12:53:49

package com.job;

public class MatchSmsOpenJob {
 public void execute(){
  System.out.println("do it...");

怎么操作数据库????
 }
}

奈何桥上唱咆哮 2021-11-25 03:27:42

去掉最后的定时任务就正常

百思不得你姐 2021-11-24 14:47:03

配置错,无法获取数据库连接

Failed to obtain DB connection from data source

终止放荡 2021-11-24 03:05:57

package com.job;

public class MatchSmsOpenJob {
 public void execute(){
  System.out.println("do it...");
 }
}

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文