title: Spring Quartz-scheduler : class not found Exception
body: <p>I am using quartz-scheduler (version 2.3.0). It is giving the following Class not found exception when triggering the job. The class is there in the code. As a result, trigger state is marked to error. <b>The same code is deployed on other server and its running fine there without any exception.</b>. Not able to deduce why this is happening.</p>
  
  <p>Exception : </p>
  
  <pre><code>Error retrieving job, setting trigger state to ERROR.
  org.quartz.JobPersistenceException: Couldn't retrieve job because a required class was not found: 
  </code></pre>
  
  <pre class="lang-java prettyprint-override"><code>@Configuration
  @EnableScheduling
  @DisallowConcurrentExecution
  @PropertySources(value = {@PropertySource("classpath:quartz.properties")})
  public class BillingInit implements Job {
  
    @Value("${cron.billing.init.cron.expression}")
    private String expression;
  
    @Autowired
    private BillingSchedulerService schedulerService;
  
    @Override
    public void execute(final JobExecutionContext jobExecutionContext) {
      schedulerService.scheduleBill();
    }
  
    @Bean(name = "billingInitCron")
    public JobDetailFactoryBean sampleJob() {
      return ConfigureQuartz.createJobDetail(this.getClass());
    }
  
    @Bean(name = "billingInitCronTrigger")
    public CronTriggerFactoryBean billingJobTrigger(
        @Qualifier("billingInitCron") final JobDetail jobDetail) {
      return ConfigureQuartz.createCronTrigger(jobDetail, expression);
    }
  }
  
  </code></pre>
  
  <p>ConfigureQuartz.java</p>
  
  <pre><code>public static CronTriggerFactoryBean createCronTrigger(final JobDetail jobDetail,
        final String cronExpression) {
      CronTriggerFactoryBean factoryBean = new CronTriggerFactoryBean();
      factoryBean.setJobDetail(jobDetail);
      factoryBean.setCronExpression(cronExpression);
      factoryBean.setMisfireInstruction(SimpleTrigger.MISFIRE_INSTRUCTION_FIRE_NOW);
      return factoryBean;
    }
  
  public static JobDetailFactoryBean createJobDetail(
        @SuppressWarnings("rawtypes") final Class jobClass) {
      JobDetailFactoryBean factoryBean = new JobDetailFactoryBean();
      factoryBean.setJobClass(jobClass);
      // job has to be durable to be stored in DB:
      factoryBean.setDurability(true);
      return factoryBean;
    }
  </code></pre>
  
  <p>quartz.properties</p>
  
  <pre><code>org.quartz.scheduler.instanceId = AUTO
  org.quartz.scheduler.makeSchedulerThreadDaemon = true
  
  org.quartz.threadPool.class = org.quartz.simpl.SimpleThreadPool
  org.quartz.threadPool.makeThreadsDaemons = true
  org.quartz.threadPool.threadCount: 20
  org.quartz.threadPool.threadPriority: 5
  
  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.isClustered = true
  org.quartz.jobStore.dataSource = myDs
  org.quartz.jobStore.misfireThreshold = 25000
  cron.billing.init.cron.expression = 0 0 0 * * ?
  </code></pre>