title: Unexpected error occurred in scheduled task
body: <p>I tried to run a scheduled task in my Spring-Boot application, using the default <code>applicationConfig</code> - I only added the annotation <code>@EnableScheduling</code> and configured the class with the method that is to be scheduled, per the following code sample:</p>
  <pre><code>@Component 
  public class Task { 
  
   @Scheduled(cron =&quot;*/10 * * * * *&quot;)
    public void init() {
      System.out.println(&quot;QuartzConfig initialized.&quot;);
      System.out.println(callService());
    }
  
    private String callService() {
      String urlService = &quot;https://www.google.com&quot;;
      GetMethod method = new GetMethod(urlService );
      String response = &quot;&quot;;
      try {
          client.executeMethod(method);
          response = method.getResponseBodyAsString();
      } catch (IOException e) {
         e.printStackTrace();
      } finally {
          method.releaseConnection();
      }
      return response;
    }
  }
  </code></pre>
  <p>However, when the task is called, the method <code>callService</code> returns the following error:</p>
  <pre><code>java.lang.NullPointerException: null
  </code></pre>
  <p>This, quite obviously, makes me sad.</p>