This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Tomcat and the fly likes Quartz scheduler stopped in tomcat Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Quartz scheduler stopped in tomcat" Watch "Quartz scheduler stopped in tomcat" New topic
Author

Quartz scheduler stopped in tomcat

Jomy George
Ranch Hand

Joined: Jan 13, 2011
Posts: 65
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

Joined: Jul 26, 2007
Posts: 10167
    
    8

One logical place to check would be the logs. Anything there?


[How to ask questions] [Donate a pint, save a life!] [Onff-turn it on!]
Jomy George
Ranch Hand

Joined: Jan 13, 2011
Posts: 65
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

Joined: Jun 25, 2001
Posts: 15952
    
  19

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.


Customer surveys are for companies who didn't pay proper attention to begin with.
Kenubie Wong
Greenhorn

Joined: May 31, 2012
Posts: 1
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

Joined: Jun 25, 2001
Posts: 15952
    
  19

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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Quartz scheduler stopped in tomcat
 
Similar Threads
Data exchange between threads
Spring quartz not started with jpa hibernate
Tomcat Duplicate Deploy
Spring Quartz Shutdown issue
Thread yielding