Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Quartz scheduler stopped in tomcat

 
Jomy George
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Friends,

I have an issue in Tomcat 7 server. My application uses Quartz scheduler to do a job in every 10 minutes.
Sometimes this job won’t get completed in 10 minutes, and may take a few hours to get completed.
Now I just noticed that after some time (60-70 minutes) my running job get stalled.

When my job was working I could see one job ‘DefaultQuartzScheduler_Worker-0’ is in RUNNABLE state and other 9 threads ‘DefaultQuartzScheduler_Worker-1 to 9’ are in ‘TIMED_WAITING’ state.
But once it stalled then in thread dump I can’t see my running thread ‘DefaultQuartzScheduler_Worker-0’, and other 9 threads still in ‘TIMED_WAITING’

Seems like my thread which was executing this job terminated suddenly.

Anyone got the same issue before? Please let me know if anyone knows how to solve this issue…

Thanks in advance…
 
Maneesh Godbole
Saloon Keeper
Posts: 11021
12
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
One logical place to check would be the logs. Anything there?
 
Jomy George
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Maneesh,

In logs i cant see any error or exception. I can see the job going on smoothly till a point.
Then nothing can see about this job in logs.
 
Tim Holloway
Saloon Keeper
Pie
Posts: 17989
47
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Quartz is not a stand-alone scheduler nor a component of the J2EE (Tomcat) server. Every application that uses Quartz has its own instance of Quartz as part of the application. What that means in particular is that when a Quartz thread dies, any stacktrace or other post-mortem information will not automatically show up in the Tomcat logs. Each Tomcat webapp is responsible for its own logging. So you should look in that particular application's logfiles. If the application isn't set up to log, make it do so. It should, anyway. System.out.println isn't good enough.
 
Kenubie Wong
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, I am seeing something very similar or even identical. On tomcat, after the quartz scheduler tasks have been running for a week or two, the jobs would just stop running. It's like the scheduler threads all hung or died. So far i have not seen any causes or solution posted on the internet anywhere !
 
Tim Holloway
Saloon Keeper
Pie
Posts: 17989
47
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Kenubie Wong wrote:Yes, I am seeing something very similar or even identical. On tomcat, after the quartz scheduler tasks have been running for a week or two, the jobs would just stop running. It's like the scheduler threads all hung or died. So far i have not seen any causes or solution posted on the internet anywhere !


I'm not surprised. Tomcat doesn't get involved and Quartz is very reliable, so the cause is almost invariably bugs in the user code and the solution is to debug the code.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic