title: Setting bean property 'jobClass' of org.springframework.scheduling.quartz.JobDetailBean
body: <p>My project has a Quartz scheduler and I am setting the JobDetailBean as</p>
  
  <pre><code>&lt;bean id="deadlineFailureChecker" class="info.release.scheduler.DeadlineFailureChecker" /&gt;
  
  &lt;bean id="workingHourPerDayUpdater" class="info.release.scheduler.WorkingHourPerDayUpdater" /&gt;
  
  &lt;bean name="scheduledJob" class="org.springframework.scheduling.quartz.JobDetailBean"&gt;
      &lt;property name="jobClass" value="info.release.scheduler.ScheduledJob" /&gt;
      &lt;property name="jobDataAsMap"&gt;
          &lt;map&gt;
              &lt;entry key="deadlineFailureChecker" value-ref="deadlineFailureChecker" /&gt;
              &lt;entry key="workingHourPerDayUpdater" value-ref="workingHourPerDayUpdater" /&gt;
          &lt;/map&gt;
      &lt;/property&gt;     
  &lt;/bean&gt;
  </code></pre>
  
  <p>Now as I want pass a property value to the info.release.scheduler.ScheduledJob I did:</p>
  
  <pre><code>&lt;bean id="scheduledJobBean" class="info.release.scheduler.ScheduledJob"&gt;
      &lt;property name="afrodite" ref="afrodite" /&gt;
  &lt;/bean&gt;
  
  &lt;bean name="scheduledJob" class="org.springframework.scheduling.quartz.JobDetailBean"&gt;
      &lt;property name="jobClass"&gt;
          &lt;bean factory-bean="scheduledJobBean" factory-method="getClass"&gt;&lt;/bean&gt;
      &lt;/property&gt;
      &lt;property name="jobDataAsMap"&gt;
          &lt;map&gt;
              &lt;entry key="deadlineFailureChecker" value-ref="deadlineFailureChecker" /&gt;
              &lt;entry key="workingHourPerDayUpdater" value-ref="workingHourPerDayUpdater" /&gt;
          &lt;/map&gt;
      &lt;/property&gt;     
  &lt;/bean&gt;
  </code></pre>
  
  <p>But the following <code>System.out.println</code> is printing <code>null</code>:</p>
  
  <pre><code>@Override
  protected void executeInternal(JobExecutionContext context) throws JobExecutionException {
      System.out.println("============================================="+this.afrodite);
  
  }
  </code></pre>
  
  <p>This method belongs to <code>info.release.scheduler.ScheduledJob extends QuartzJobBean</code>.</p>
  
  <p>I also did an experiment, I set </p>
  
  <pre><code>&lt;bean id="scheduledJobBean" class="info.release.scheduler.ScheduledJob"&gt;
      &lt;property name="afrodite" ref="afrodite" /&gt;
  &lt;/bean&gt; 
  </code></pre>
  
  <p>To</p>
  
  <pre><code>&lt;bean id="scheduledJobBean" class="info.release.scheduler.ScheduledJob" init-method="init"&gt;
      &lt;property name="afrodite" ref="afrodite" /&gt;
  &lt;/bean&gt;
  </code></pre>
  
  <p>and</p>
  
  <pre><code>public void init() {
      System.out.println("============================================="+this.afrodite);
  }
  </code></pre>
  
  <p>In this init the <code>System.out.println</code> isn't printing null rather a value.</p>
  
  <p>I cannot understand what is going on! Is JobDetailBean re-instantiating the jobClass object?</p>
  
  <p>What I need is to set a property of the value-class of the <code>jobClass</code> property of <code>JobDetailBean</code>.</p>
  
  <p>Thanks and regards. </p>