title: Spring injection on current context for autowire doesnt work?
body: <p>I've got problem when I used autowire in my Quartz job. I see that the problem is because the job created by Quartz not Spring, I've used SpringBeanAutowiringSupport.processInjectionBasedOnCurrentContext(this); on the first line of execute in my job. 
  <strong>The strange thing is, It run fine in my localhost, but when I deployed it in the server it wont autowired and the injection cannot be done, so the service is null</strong>, I got this message </p>
  
  <pre><code>"Current WebApplicationContext is not available for processing of
  MeterReadingJob: Make sure this class gets constructed in a Spring web
  application. Proceeding without injection."
  </code></pre>
  
  <p>from SpringBeanAutowiringSupport.</p>
  
  <p>I've already match java,and tomcat between my localhost and the server but it still throw same error.</p>
  
  <p>This is my ApplicationListener</p>
  
  <pre><code>@Component
  public class QuartzInitializerListener implements ApplicationListener&lt;ContextRefreshedEvent&gt;
  {
      @Autowired
      private JobService jobService;
  
      public void onApplicationEvent(ContextRefreshedEvent event) {
          System.out.println("Starting The Event :"+event.getApplicationContext().getDisplayName());
          if(event.getApplicationContext().getParent() == null){
              jobService.meterReadingJob();
          }
      }
  
  
  }
  </code></pre>
  
  <p>this is the MeterReadingJob class:</p>
  
  <pre><code>@Component
  public class MeterReadingJob implements Job  {
  
      private Logger logger = Logger.getLogger(this.getClass());
  
      @Autowired(required = true)
      private TransactionService trxSvc; //This one doesnt autowired correctly
  
      public void execute(JobExecutionContext jec) throws JobExecutionException {
          SpringBeanAutowiringSupport.processInjectionBasedOnCurrentContext(this); //work on localhost only..
  
          MapTbl mapTbl = (MapTbl)jec.getJobDetail().getJobDataMap().get("mapTbl");
          System.out.println("SERVICE: "+trxSvc);
          String trxId = trxSvc.validTxIdWithS(4);
          ......
      }
  </code></pre>
  
  <p>this is web.xml for the listener</p>
  
  <pre><code>&lt;listener&gt;
      &lt;listener-class&gt;org.springframework.web.context.ContextLoaderListener&lt;/listener-class&gt; 
  &lt;/listener&gt;
  </code></pre>
  
  <p>this is my scheduler service method for the meter reading job</p>
  
  <pre><code>/*
       * Meter reading schedule for all mapped meter
       */
      public void meterReadingJob() {
          List&lt;MapTbl&gt; mapTbls = mapTblDao.findAll();
          try {
              if(scheduler.isShutdown()){
                  scheduler = StdSchedulerFactory.getDefaultScheduler();
              }
              for(MapTbl mapTbl : mapTbls){       
                  if(mapTbl.getInterval()!=0){
                      JobDetail job = JobBuilder.newJob(MeterReadingJob.class)
                              .withIdentity( mapTbl.getMapId().toString(), "MeterReading").build();
  
                      job.getJobDataMap().put("mapTbl", mapTbl);
  
                      Trigger trigger = TriggerBuilder.newTrigger()
                              .withIdentity( mapTbl.getMapId().toString(), "MeterReading")
                              .withSchedule(
                                  SimpleScheduleBuilder.simpleSchedule()
                                      .withIntervalInMilliseconds(mapTbl.getInterval())
                                      .repeatForever())
                              .startNow()
                              .build();
                          scheduler.scheduleJob(job, trigger);
                  }
              }
              if(mapTbls !=null &amp;&amp; mapTbls.size()&gt;0 &amp;&amp; !scheduler.isStarted()){
                  scheduler.start();
              }
          } catch (SchedulerException e) {
              e.printStackTrace();
          }
  
  
  
      }
  </code></pre>
  
  <p>It run smoothly in my localhost, but in my server the service always null [not autowired]</p>
  
  <p>Is there anything that I missed so it wont run in my server?
  Im using apache tomcat 7.0.42 jdk 7 springframework 3.2.0</p>