code: private void initializeApplicationContext(JobExecutionContext jobExecutionContext) throws JobExecutionException {
          try {
              this.applicationContext = (ApplicationContext) jobExecutionContext.getScheduler().getContext().get("applicationContext");
              if (this.applicationContext == null) {
                  throw new JobExecutionException("No application context available in scheduler context for key \"applicationContext\"");
              }
          } catch (SchedulerException e) {
              getLogger().error("Error extracting Spring application context from SchedulerContext", e);
              throw new JobExecutionException("Error fetching application context available in scheduler context for key \"applicationContext\"");
          }
      }
docs: Initialize Spring Application Context from Quartz SchedulerContext.
  
  @param jobExecutionContext
  the {@link JobExecutionContext} to use
  
  @throws JobExecutionException
  if something fails