Scheduled the first java Quartz job successfully with the instructions mentioned in – http://quartz-scheduler.org/documentation/quartz-2.1.x/examples/Example1
Since its a standalone application, we are using main method. I want to make it a container managed one. So, i added the code as per the instructions in – http://quartz-scheduler.org/documentation/quartz-2.1.x/cookbook/ServletInitScheduler
But am unable to run the job automatically at the scheduled time, with in the container environment. I have to still use the main method and run the job manually.
Please suggest me a solution for this.
Here is the link for the quartz scheduler code.
https://gist.github.com/60b236e7fd1432c76248
I think you have a couple of issues to sort out.
Check the quartz docs and mod your web.xml to use either the listener or servlet approach. You currently have both.
You need another servlet to run inside tomcat to create a job. Google for how to create a simple servlet or ask for more info. You must grab the scheduler factory created by the quartz init servlet – check the javadocs for the quartz init servlet for how to do this. They make it available on the servlet context for other servlets to grab