spring+quartz 启动时报错!
jzeyy 2016-12-02 10:55:45 严重: StandardWrapper.Throwable
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'quartzScheduler' defined in ServletContext resource [/WEB-INF/applicationContext-task.xml]: Invocation of init method failed; nested exception is org.quartz.JobPersistenceException: Failed to obtain DB connection from data source 'springTxDataSource.TestScheduler': java.sql.SQLRecoverableException: IO 错误: The Network Adapter could not establish the connection [See nested exception: java.sql.SQLRecoverableException: IO 错误: The Network Adapter could not establish the connection]
Caused by: org.quartz.JobPersistenceException: Failed to obtain DB connection from data source 'springTxDataSource.TestScheduler': java.sql.SQLRecoverableException: IO 错误: The Network Adapter could not establish the connection [See nested exception: java.sql.SQLRecoverableException: IO 错误: The Network Adapter could not establish the connection]
at org.quartz.impl.jdbcjobstore.JobStoreSupport.getConnection(JobStoreSupport.java:689)
spring 中配置quartz
<bean name="quartzScheduler" class="org.springframework.scheduling.quartz.SchedulerFactoryBean" autowire="no">
<property name="dataSource">
<ref bean="dataSource"/>
</property>
<property name="applicationContextSchedulerContextKey" value="applicationContextKey"/>
<property name="configLocation" value="classpath:quartz.properties"/>
...................
quartz.properties中的配置
#============================================================================
# Configure Main Scheduler Properties
#============================================================================
org.quartz.scheduler.instanceName = TestScheduler
org.quartz.scheduler.instanceId = AUTO
#============================================================================
# Configure ThreadPool
#============================================================================
org.quartz.threadPool.class = org.quartz.simpl.SimpleThreadPool
org.quartz.threadPool.threadCount = 100
org.quartz.threadPool.threadPriority = 5
#============================================================================
# Configure JobStore
#============================================================================
org.quartz.jobStore.misfireThreshold = 60000
#save the jobStore items in RAM
org.quartz.jobStore.class = org.quartz.impl.jdbcjobstore.JobStoreTX
org.quartz.jobStore.driverDelegateClass=org.quartz.impl.jdbcjobstore.StdJDBCDelegate
org.quartz.jobStore.tablePrefix = QRTZ_
org.quartz.jobStore.maxMisfiresToHandleAtATime=10
org.quartz.jobStore.isClustered = true
org.quartz.jobStore.clusterCheckinInterval = 20000