Quartz. Cannot add Job

Hi
I known that add job need add next code:

    JobDetail job = newJob(CompanyJob.class)
                    .withIdentity("CompanyJob", "CompanyJob")
                    .ofType(CompanyJob.class)
                    .storeDurably()
                    .build();

            scheduler.addJob(job,true);

And I want add the code on start application…but @Autowired scheduler = null

where can I add the code so that when the application is raised, they are added jobs

thx

Look at how it is done in the framework:

1 Like