applicationContext.xml calls the CronTriggerScheduler but application isn't scheduled
<p>I'm working with IntelliJ Idea and using Tomcat as a local server.
I try to insert data into MySQL database in 5 seconds. I schedule the application with Cron Trigger in applicationContext.xml file.  </p>

<p>In applicationContext.xml file, i have dummycode as a cron trigger which calls CurrencyAddJob.java, schedules my class already. But when i create a new java class which is called CronTriggerScheduler.java and run my application, application is not scheduled.</p>

<p>applicationContext.xml:</p>

<pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;beans xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:context="http://www.springframework.org/schema/context"
       xmlns="http://www.springframework.org/schema/beans"
       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
                        http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd"&gt;


    &lt;context:annotation-config/&gt;

    &lt;context:component-scan base-package="com.honorius.billing.*"&gt;
    &lt;/context:component-scan&gt;

    &lt;context:property-placeholder location="classpath:com"/&gt;



&lt;bean id="honoriusDataSource" class="org.apache.tomcat.jdbc.pool.DataSource" destroy-method="close"&gt;
        &lt;property name="driverClassName" value="com.mysql.jdbc.Driver"/&gt;
        &lt;property name="url" value="jdbc:mysql://url adress here"/&gt;
        &lt;property name="username" value="root"/&gt;
        &lt;property name="password" value="password"/&gt;
        &lt;property name="jmxEnabled" value="true"/&gt;
        &lt;property name="initialSize" value="10"/&gt;
        &lt;property name="maxActive" value="2000"/&gt;
        &lt;property name="maxIdle" value="500"/&gt;
        &lt;property name="minIdle" value="10"/&gt;
        &lt;property name="suspectTimeout" value="60"/&gt;
        &lt;property name="timeBetweenEvictionRunsMillis" value="30000"/&gt;
        &lt;property name="minEvictableIdleTimeMillis" value="60000"/&gt;
        &lt;property name="validationQuery" value="select 1 from dual;"/&gt;
        &lt;property name="testOnConnect" value="true"/&gt;
        &lt;property name="testWhileIdle" value="true"/&gt;
    &lt;/bean&gt;

    &lt;bean id="jdbcTemplate" class="org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate"&gt;
        &lt;constructor-arg ref="honoriusDataSource"/&gt;
    &lt;/bean&gt;


    &lt;bean class="org.springframework.scheduling.quartz.SchedulerFactoryBean"&gt;
        &lt;property name="applicationContextSchedulerContextKey" value="applicationContext"/&gt;

        &lt;property name="overwriteExistingJobs" value="true"/&gt;
        &lt;property name="jobDetails"&gt;
            &lt;list&gt;
                &lt;ref bean="dailyCountJob"/&gt;
            &lt;/list&gt;
        &lt;/property&gt;
        &lt;property name="triggers"&gt;
            &lt;list&gt;
                &lt;ref bean="dailyCountJobCronTrigger"/&gt;
            &lt;/list&gt;
        &lt;/property&gt;
    &lt;/bean&gt;

    &lt;bean id="mySched" class="com.honorius.billing.CronTriggerScheduler" init-method="init"&gt;&lt;/bean&gt;

&lt;/beans&gt;
</code></pre>

<p>CurrencyAddJob.java:</p>

<pre><code>package com.honorius.billing.job;

import com.honorius.billing.dao.impl.CurrenciesDao;
import com.honorius.billing.service.AsynchronousRunnerService;
import com.honorius.billing.service.task.AddCurrencyTask;
import com.honorius.billing.dao.model.Currencies;
import com.honorius.billing.service.CurrencyService;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.quartz.SchedulerException;
import org.springframework.context.ApplicationContext;
import org.springframework.scheduling.quartz.QuartzJobBean;

public class CurrencyAddJob extends QuartzJobBean {

    private transient CurrenciesDao currenciesDao;
    private transient CurrencyService currencyService;
    private transient AsynchronousRunnerService asynchronousRunnerService;


    @Override
    protected void executeInternal(JobExecutionContext jobExecutionContext)
            throws JobExecutionException {


        // spring quartz initializes from applicationContext
        ApplicationContext applicationContext = null;
        try {
            applicationContext = (ApplicationContext) jobExecutionContext
                    .getScheduler().getContext().get("applicationContext");
        } catch (SchedulerException e1) {
            e1.printStackTrace();
        }
        if (applicationContext != null) {
            currenciesDao = applicationContext.getBean(CurrenciesDao.class);
        }
        //if (currencyService == null) {
        //    currencyService = (CurrencyService) applicationContext.getBean("currencyService");
        //}
        if (currenciesDao == null) {
            currenciesDao = (CurrenciesDao) jobExecutionContext.getJobDetail()
                    .getJobDataMap().get("CurrenciesDao");
        }
        if (asynchronousRunnerService == null) {
            assert applicationContext != null;
            asynchronousRunnerService = (AsynchronousRunnerService) applicationContext.getBean("asynchronousRunnerService");
        }


        //// TODO: INSERT TO CURRENCY TABLE

        Currencies curr = new Currencies();
        //curr.setId(Long.valueOf(10));
        curr.setId(null);
        curr.setIso("Suc");
        curr.setName("Honorius");


        asynchronousRunnerService.runAsynchronously(new AddCurrencyTask(currenciesDao, curr));
    }
}
</code></pre>

<p>web.xml:</p>

<pre><code>&lt;web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.5"
     xmlns="http://java.sun.com/xml/ns/javaee"
     xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
                    http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"&gt;

&lt;display-name&gt;Honorius Batch Application&lt;/display-name&gt;

&lt;context-param&gt;
    &lt;param-name&gt;contextConfigLocation&lt;/param-name&gt;
    &lt;param-value&gt;classpath:applicationContext.xml&lt;/param-value&gt;
&lt;/context-param&gt;

&lt;listener&gt;
    &lt;listener-class&gt;org.springframework.web.context.ContextLoaderListener&lt;/listener-class&gt;
&lt;/listener&gt;
</code></pre>

<p></p>

<p>It works perfectly and every in 5 seconds a new data is inserted into CurrencyTable. But when the applicationContext.xml is updated and CronTriggerSchedler.java is created, applicationContext and asynchronousRunnerService variable ,in CurrencyAddJob.java, will become "null" in debug mode. Application stucks in loop after CurrecnyAddJob.java is called.</p>

<p>Updated applicationContext.xml:</p>

<pre><code>    &lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;beans xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:context="http://www.springframework.org/schema/context"
       xmlns="http://www.springframework.org/schema/beans"
       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
                        http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd"&gt;

    &lt;context:annotation-config/&gt;

    &lt;context:component-scan base-package="com.honorius.billing.*"&gt;
    &lt;/context:component-scan&gt;

    &lt;context:property-placeholder location="classpath:com"/&gt;

&lt;bean id="honoriusDataSource" class="org.apache.tomcat.jdbc.pool.DataSource" destroy-method="close"&gt;
        &lt;property name="driverClassName" value="com.mysql.jdbc.Driver"/&gt;
        &lt;property name="url" value="jdbc:mysql://url address here"/&gt;
        &lt;property name="username" value="root"/&gt;
        &lt;property name="password" value="password"/&gt;
        &lt;property name="jmxEnabled" value="true"/&gt;
        &lt;property name="initialSize" value="10"/&gt;
        &lt;property name="maxActive" value="2000"/&gt;
        &lt;property name="maxIdle" value="500"/&gt;
        &lt;property name="minIdle" value="10"/&gt;
        &lt;property name="suspectTimeout" value="60"/&gt;
        &lt;property name="timeBetweenEvictionRunsMillis" value="30000"/&gt;
        &lt;property name="minEvictableIdleTimeMillis" value="60000"/&gt;
        &lt;property name="validationQuery" value="select 1 from dual;"/&gt;
        &lt;property name="testOnConnect" value="true"/&gt;
        &lt;property name="testWhileIdle" value="true"/&gt;
    &lt;/bean&gt;

    &lt;bean id="jdbcTemplate" class="org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate"&gt;
        &lt;constructor-arg ref="honoriusDataSource"/&gt;
    &lt;/bean&gt;
   &lt;bean id="mySched" class="com.honorius.billing.CronTriggerScheduler" init-method="init"&gt;&lt;/bean&gt;

&lt;/beans&gt;
</code></pre>

<p>CronTriggerScheduler.java:</p>

<pre><code>    public class CronTriggerScheduler {

    public void init(){
        scheduler();
    }
    public static void scheduler(){

        try {
            Scheduler scheduler;
            scheduler = new StdSchedulerFactory().getScheduler();
            scheduler.start();

            JobDetail job = JobBuilder.newJob(CurrencyAddJob.class)
                    .withIdentity("DailyJobs", "group").build();

            Trigger trigger = TriggerBuilder
                    .newTrigger()
                    .withIdentity("dailyJobCronTrigger", "group")
                    .withSchedule(
                            CronScheduleBuilder.cronSchedule("0/5  * * * * ?"))
                    .build();


            scheduler.scheduleJob(job, trigger);
        } catch (SchedulerException e) {
            e.printStackTrace();
        }
    }
}
</code></pre>

<p>How can i schedule my applciation with using CronTriggerScheduler.java.
Any help will be appreciated.</p>