springbot石英群集配置问题

时间:2018-10-04 03:15:35

标签: java spring spring-boot quartz-scheduler quartz

我收到这样的错误

4:18:08.373 ERROR Error when initializing config manager scheduler
18:09:16.477 INFO  Scheduler QUOTA-Scheduler_$_herman-Java1538564956465 shutting down.
18:09:16.477 INFO  Scheduler QUOTA-Scheduler_$_herman-Java1538564956465 paused.
18:09:16.477 DEBUG Shutting down threadpool...
18:09:16.478 DEBUG Shutdown of threadpool complete.
18:09:16.487 WARN  Database connection shutdown unsuccessful.
java.sql.SQLException: There is no DataSource named 'null'
    at org.quartz.utils.DBConnectionManager.shutdown(DBConnectionManager.java:135)
    at org.quartz.impl.jdbcjobstore.JobStoreSupport.shutdown(JobStoreSupport.java:746)
    at org.quartz.core.QuartzScheduler.shutdown(QuartzScheduler.java:732)
    at org.quartz.impl.StdSchedulerFactory.shutdownFromInstantiateException(StdSchedulerFactor

这是我对石英数据源的配置

@Bean
public DataSource schedulerDataSource() {
    final HikariDataSource dataSource = new HikariDataSource();
    dataSource.setUsername(pref.DATASOURCE_AMS_USERNAME);
    dataSource.setPassword(pref.DATASOURCE_AMS_PASSWORD);
    dataSource.setJdbcUrl(pref.DATASOURCE_JDBC_URL+"Quartz");
    dataSource.setMaximumPoolSize(pref.DATASOURCE_CONNECTION_POOL_MAX);
    return dataSource;
}   
@Bean
public SchedulerFactoryBean schedulerFactoryBean(DataSource dataSource, ApplicationContext applicationContext) throws IOException
{ 
    SchedulerFactoryBean factory = new SchedulerFactoryBean();
    factory.setDataSource(dataSource);
    factory.setOverwriteExistingJobs(true);
    factory.setAutoStartup(true);
    factory.setQuartzProperties(quartzProperties());
    AutowiringSpringBeanJobFactory jobFactory = new AutowiringSpringBeanJobFactory();
    jobFactory.setApplicationContext(applicationContext);
    factory.setJobFactory(jobFactory);

    return factory;
}

@Bean
public Properties quartzProperties() throws IOException {
    PropertiesFactoryBean propertiesFactoryBean = new PropertiesFactoryBean();
    propertiesFactoryBean.setLocation(new ClassPathResource("quartz.properties"));
    propertiesFactoryBean.afterPropertiesSet();
    return propertiesFactoryBean.getObject();
}

属性:

org.quartz.jobStore.class=org.quartz.impl.jdbcjobstore.JobStoreTX
    org.quartz.jobStore.driverDelegateClass=org.quartz.impl.jdbcjobstore.StdJDBCDelegate
org.quartz.jobStore.useProperties=true
org.quartz.jobStore.misfireThreshold=60000
org.quartz.jobStore.tablePrefix=QRTZ_

org.quartz.jobStore.isClustered=true
org.quartz.jobStore.clusterCheckinInterval=20000

请帮助解决什么问题,因为它会干扰Rabbitmq配置

0 个答案:

没有答案