title: Error handling for spring scheduled tasks
body: <p><strong>spring-scheduler.xml</strong>:</p>
  
  <pre><code>&lt;beans xmlns="http://www.springframework.org/schema/beans"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xmlns:context="http://www.springframework.org/schema/context"
     xmlns:task="http://www.springframework.org/schema/task"
     xsi:schemaLocation="http://www.springframework.org/schema/beans
  http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd http://www.springframework.org/schema/task http://www.springframework.org/schema/task/spring-task.xsd"&gt;
  
  &lt;context:component-scan base-package="com.xxxx.xxxx"/&gt;
  
  &lt;bean id="xmlScheduledTask" class="com.xxxx.xxxx.xxxx"/&gt;
  
  &lt;task:scheduler id="taskScheduler" pool-size="10"/&gt;
  
  &lt;task:scheduled-tasks&gt;
      &lt;task:scheduled ref="xmlScheduledTask" method="job" cron="*/10 * * * * *"/&gt;
  &lt;/task:scheduled-tasks&gt;
  </code></pre>
  
  <p></p>
  
  <p>I am using the following code to load the configuration.</p>
  
  <pre><code>@SuppressWarnings({"resource", "unused" })  
  ApplicationContext context = new ClassPathXmlApplicationContext("spring/config/spring-scheduler.xml");
  </code></pre>
  
  <p>Is there a way to check if my tasks are scheduled? Is there a way to throw error if there is no schedule or scheduled-tasks missing in the xml?</p>