quartz连数据库

这几天搞quartz头都弄大了,求高手给我解答;
下面是我的简单job实现类
package com.quartz.sping;

import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;

public class JobTest implements Job{

public void execute(JobExecutionContext arg0) throws JobExecutionException {
// TODO Auto-generated method stub
System.out.println("运行名称"+arg0.getJobDetail().getJobClass().getName());

}


}
//下面开始简单scheduler
package com.quartz.sping;

import java.util.Date;

import org.quartz.JobDetail;
import org.quartz.Scheduler;
import org.quartz.SchedulerException;
import org.quartz.SimpleTrigger;
import org.quartz.Trigger;
import org.quartz.impl.StdSchedulerFactory;
public class ScheduleServiceImpl {
public static void main(String args[]) throws SchedulerException{
Scheduler scheduler=StdSchedulerFactory.getDefaultScheduler();
JobDetail jobDetail=new JobDetail("JobTest",Scheduler.DEFAULT_GROUP,JobTest.class);
Trigger trigger =
new SimpleTrigger("myTrigger",
Scheduler.DEFAULT_GROUP, new Date(), null,
SimpleTrigger.REPEAT_INDEFINITELY,
60000L);
scheduler.scheduleJob(jobDetail, trigger);
scheduler.start();
}
}
我的quartz.properties是这样配的:
# Default Properties file for use by StdSchedulerFactory
# to create a Quartz Scheduler Instance, if a different
# properties file is not explicitly specified.
#

org.quartz.scheduler.instanceName = TestScheduler1
org.quartz.scheduler.instanceId = instance_one
#==============================================================
#Configure ThreadPool
#==============================================================
org.quartz.threadPool.class= org.quartz.simpl.SimpleThreadPool
org.quartz.threadPool.threadCount = 5
org.quartz.threadPool.threadPriority = 5
#==============================================================
#Configure JobStore
#==============================================================
org.quartz.jobStore.misfireThreshold = 60000
org.quartz.jobStore.class = org.quartz.impl.jdbcjobstore.JobStoreTX
org.quartz.jobStore.driverDelegateClass = org.quartz.impl.jdbcjobstore.oracle.OracleDelegate
org.quartz.jobStore.tablePrefix = qrtz_
org.quartz.jobStore.dataSource = myDS

org.quartz.jobStore.isClustered =false
org.quartz.jobStore.clusterCheckinInterval = 20000
#==============================================================
#Non-Managed Configure Datasource
#==============================================================
org.quartz.dataSource.myDS.driver = oracle.jdbc.driver.OracleDriver
org.quartz.dataSource.myDS.URL = jdbc:oracle:thin:@196.128.1.158:1521:tasktest

org.quartz.dataSource.myDS.user = cjw
org.quartz.dataSource.myDS.password = 116118
org.quartz.dataSource.myDS.maxConnections = 10
[b][color=red]简单运行后出现[/color][/b]、、、、、、、
2011-11-09 14:47:28,468 [main] INFO org.quartz.core.QuartzScheduler - Quartz Scheduler v.1.5.2 created.
2011-11-09 14:47:28,468 [main] INFO org.quartz.impl.jdbcjobstore.JobStoreTX - Using thread monitor-based data access locking (synchronization).
Exception in thread "main" org.quartz.SchedulerConfigException: Failure occured during job recovery. [See nested exception: org.quartz.JobPersistenceException: Couldn't clean volatile data: ORA-00904: "IS_VOLATILE": 标识符无效
[See nested exception: java.sql.SQLException: ORA-00904: "IS_VOLATILE": 标识符无效
]]
at org.quartz.impl.jdbcjobstore.JobStoreSupport.initialize(JobStoreSupport.java:493)
at org.quartz.impl.jdbcjobstore.JobStoreTX.initialize(JobStoreTX.java:68)
at org.quartz.impl.StdSchedulerFactory.instantiate(StdSchedulerFactory.java:1010)
at org.quartz.impl.StdSchedulerFactory.getScheduler(StdSchedulerFactory.java:1152)
at org.quartz.impl.StdSchedulerFactory.getDefaultScheduler(StdSchedulerFactory.java:1168)
at com.quartz.sping.ScheduleServiceImpl.main(ScheduleServiceImpl.java:13)
* Nested Exception (Underlying Cause) ---------------
org[b][color=red].quartz.JobPersistenceException: Couldn't clean volatile data: ORA-00904: "IS_VOLATILE": 标识符无效[/color][/b] [See nested exception: java.sql.SQLException: ORA-00904: "IS_VOLATILE": 标识符无效
]
at org.quartz.impl.jdbcjobstore.JobStoreSupport.cleanVolatileTriggerAndJobs(JobStoreSupport.java:642)
at org.quartz.impl.jdbcjobstore.JobStoreTX.cleanVolatileTriggerAndJobs(JobStoreTX.java:116)
at org.quartz.impl.jdbcjobstore.JobStoreSupport.initialize(JobStoreSupport.java:491)
at org.quartz.impl.jdbcjobstore.JobStoreTX.initialize(JobStoreTX.java:68)
at org.quartz.impl.StdSchedulerFactory.instantiate(StdSchedulerFactory.java:1010)
at org.quartz.impl.StdSchedulerFactory.getScheduler(StdSchedulerFactory.java:1152)
at org.quartz.impl.StdSchedulerFactory.getDefaultScheduler(StdSchedulerFactory.java:1168)
at com.quartz.sping.ScheduleServiceImpl.main(ScheduleServiceImpl.java:13)
* Nested Exception (Underlying Cause) ---------------
java.sql.SQLException: ORA-00904: "IS_VOLATILE": 标识符无效

at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:331)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:288)
at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:745)
at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:216)
at oracle.jdbc.driver.T4CPreparedStatement.executeForDescribe(T4CPreparedStatement.java:810)
at oracle.jdbc.driver.OracleStatement.executeMaybeDescribe(OracleStatement.java:1039)
at oracle.jdbc.driver.T4CPreparedStatement.executeMaybeDescribe(T4CPreparedStatement.java:850)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1134)
at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3339)
at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:3384)
at org.apache.commons.dbcp.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:92)
at org.quartz.impl.jdbcjobstore.StdJDBCDelegate.selectVolatileTriggers(StdJDBCDelegate.java:3887)
at org.quartz.impl.jdbcjobstore.JobStoreSupport.cleanVolatileTriggerAndJobs(JobStoreSupport.java:620)
at org.quartz.impl.jdbcjobstore.JobStoreTX.cleanVolatileTriggerAndJobs(JobStoreTX.java:116)
at org.quartz.impl.jdbcjobstore.JobStoreSupport.initialize(JobStoreSupport.java:491)
at org.quartz.impl.jdbcjobstore.JobStoreTX.initialize(JobStoreTX.java:68)
at org.quartz.impl.StdSchedulerFactory.instantiate(StdSchedulerFactory.java:1010)
at org.quartz.impl.StdSchedulerFactory.getScheduler(StdSchedulerFactory.java:1152)
at org.quartz.impl.StdSchedulerFactory.getDefaultScheduler(StdSchedulerFactory.java:1168)
at com.quartz.sping.ScheduleServiceImpl.main(ScheduleServiceImpl.java:13)


[size=large][size=medium][color=red]最终我发现了原因。是因为我的quartz版本是1.5.2的而我用的quartz-oracle版本是2.1.0.数据库也是根据2.1.0下doc/dabtables/tables_oracle.sql下写的。难怪会报这样的错[/color][/size][/size]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值