title: Scheduler not running in Spring Boot
body: <p>I have created a Spring Boot application. I have configured my class that contains the scheduler method <code>startService()</code>. 
  Below is my code :</p>
  
  <p><strong>Service Class :</strong></p>
  
  <pre><code>package com.mk.service;  
  import org.springframework.beans.factory.annotation.Autowired;
  import org.springframework.scheduling.annotation.Scheduled;
  import org.springframework.stereotype.Component;
  
  import com.mk.envers.model.BossExtChange;
  import com.mk.envers.model.BossExtChangeRepository;
  
  @Component
  public class EnverseDemoService {
  
      @Autowired
      BossExtChangeRepository bossExtChangeRepository;
  
      @Scheduled(fixedRate = 30000)
      public void startService() {
          System.out.println("Calling startService()");
          BossExtChange bossExtChange = bossExtChangeRepository.findById(5256868L);
          System.out.println("bossExtChange.getDescription()---&gt;"+bossExtChange.getDescription());
          System.out.println("Ending startService()");
      }
  }
  </code></pre>
  
  <p><strong>Main Class :</strong></p>
  
  <pre><code>import org.springframework.boot.SpringApplication;
  import org.springframework.boot.autoconfigure.SpringBootApplication;
  import org.springframework.context.annotation.PropertySource;
  import org.springframework.scheduling.annotation.EnableScheduling;
  
  @SpringBootApplication
  @EnableScheduling
  @PropertySource("classpath:application.properties")
  public class EnverseDemoApplication {
  
      public static void main(String[] args) {
          SpringApplication.run(EnverseDemoApplication.class, args);
      }
  }
  </code></pre>
  
  <p>I have annotated the class as <code>@Component</code> and also method as <code>@Scheduled(fixedRate = 30000)</code> that will running as a scheduler. But while running the application as Spring Boot the scheduler does not trigger. The console show the below message:</p>
  
  <pre><code>2016-02-03 10:56:47.708  INFO 10136 --- [           main] o.s.j.e.a.AnnotationMBeanExporter        : Registering beans for JMX exposure on startup 
  2016-02-03 10:56:47.721  INFO 10136 --- [           main] com.mk.envers.EnverseDemoApplication     : Started EnverseDemoApplication in 3.231 seconds (JVM running for 3.623)
  2016-02-03 10:56:47.721  INFO 10136 --- [       Thread-2] s.c.a.AnnotationConfigApplicationContext : Closing org.springframework.context.annotation.AnnotationConfigApplicationContext@49e202ad: startup date [Wed Feb 03 10:56:44 IST 2016]; root of context hierarchy
  2016-02-03 10:56:47.721  INFO 10136 --- [       Thread-2] o.s.j.e.a.AnnotationMBeanExporter        : Unregistering JMX-exposed beans on shutdown 
  2016-02-03 10:56:47.736  INFO 10136 --- [       Thread-2] j.LocalContainerEntityManagerFactoryBean : Closing JPA EntityManagerFactory for persistence unit 'default'
  </code></pre>
  
  <p>Can anyone please help me out.</p>