title: Spring boot quartz 2.2.1 compilation error
body: <p>This is the code i have used for saving new cron job to the postgresql database.But it is showing some compile time exceptions.I have originally migrated quartz 1.8.6 to 2.2.1 with spring boot web app.see the attachment.</p>
  
  <p><a href="https://i.stack.imgur.com/2kdNN.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/2kdNN.png" alt="enter image description here"></a></p>
  
  <pre><code>private static final String JOBNAME = "sampleJobRunner";
      private static final String JOB_GROUPNAME = "sampleGroup";
  
      public void saveScheduledTime(String name) throws SchedulerException, ParseException {
          Scheduler scheduler;
          CronTrigger trigger;
          String cronExp = null;
          scheduler = this.quartzScheduler.getObject();
          trigger = (CronTrigger) scheduler.getTrigger(name, JOB_GROUPNAME);
          if (scheduler != null) {
                  cronExp = "0 0 12 ? 1 MON#1 *";
              if (trigger != null) {
                  rescheduleJob(scheduler, trigger.getName(), cronExp);
              } else {
                  createNewCronTrigger(scheduler, cronExp, name);
              }
          }
      }
      private void rescheduleJob(Scheduler scheduler, String triggerName, String cronExp)
              throws SchedulerException, ParseException {
          CronTrigger trigger = (CronTrigger) scheduler.getTrigger(triggerName, JOB_GROUPNAME);
          trigger.setCronExpression(cronExp);
          scheduler.rescheduleJob(triggerName, JOB_GROUPNAME, trigger);
      }
  
      private void createNewCronTrigger(Scheduler scheduler, String cronExp, String sentType)
              throws SchedulerException, ParseException {
          CronTrigger trigger = new CronTrigger(sentType, JOB_GROUPNAME, JOBNAME, JOB_GROUPNAME, cronExp);
          scheduler.scheduleJob(trigger);
          scheduler.start();
      }
  </code></pre>
  
  <p><strong>Spring boot quartz configuration</strong></p>
  
  <pre><code>@Configuration
  @ConditionalOnProperty(name = "quartz.enabled")
  public class SchedulerConfig {
      @Bean
      public JobFactory jobFactory(ApplicationContext applicationContext) {
          AutowiringSpringBeanJobFactory jobFactory = new AutowiringSpringBeanJobFactory();
          jobFactory.setApplicationContext(applicationContext);
          return jobFactory;
      }
      @Bean
      public SchedulerFactoryBean schedulerFactoryBean(DataSource dataSource, JobFactory jobFactory,
              @Qualifier("sampleJobTrigger") Trigger sampleJobTrigger) throws IOException {
          SchedulerFactoryBean factory = new SchedulerFactoryBean();
          // this allows to update triggers in DB when updating settings in config
          // file:
          factory.setOverwriteExistingJobs(true);
          factory.setDataSource(dataSource);
          factory.setJobFactory(jobFactory);
          factory.setQuartzProperties(quartzProperties());
          // factory.setTriggers(sampleJobTrigger);
          return factory;
      }
  
      @Bean
      public Properties quartzProperties() throws IOException {
          PropertiesFactoryBean propertiesFactoryBean = new PropertiesFactoryBean();
          propertiesFactoryBean.setLocation(new ClassPathResource("/quartz.properties"));
          propertiesFactoryBean.afterPropertiesSet();
          return propertiesFactoryBean.getObject();
      }
      @Bean
      public JobDetailFactoryBean sampleJobDetail() {
          return createJobDetail(SampleJob.class);
      }
      @Bean(name = "sampleJobTrigger")
      public SimpleTriggerFactoryBean sampleJobTrigger(@Qualifier("sampleJobDetail") JobDetail jobDetail,
              @Value("${samplejob.frequency}") long frequency) {
          return createTrigger(jobDetail, frequency);
      }
      private static JobDetailFactoryBean createJobDetail(Class jobClass) {
          JobDetailFactoryBean factoryBean = new JobDetailFactoryBean();
          factoryBean.setJobClass(jobClass);
          // job has to be durable to be stored in DB:
          factoryBean.setDurability(true);
          return factoryBean;
      }
      private static SimpleTriggerFactoryBean createTrigger(JobDetail jobDetail, long pollFrequencyMs) {
          SimpleTriggerFactoryBean factoryBean = new SimpleTriggerFactoryBean();
          factoryBean.setJobDetail(jobDetail);
          factoryBean.setStartDelay(0L);
          factoryBean.setRepeatInterval(pollFrequencyMs);
          factoryBean.setRepeatCount(SimpleTrigger.REPEAT_INDEFINITELY);
          // in case of misfire, ignore all missed triggers and continue :
          factoryBean.setMisfireInstruction(SimpleTrigger.MISFIRE_INSTRUCTION_RESCHEDULE_NEXT_WITH_REMAINING_COUNT);
          return factoryBean;
      }
  }
  </code></pre>