0

I'm currently having the following exception, I know this is because a out of memory exception, but my quartz scheduler stops working and I need to revive the job processing, any ideas?

unhandled Exception:
org.springframework.scheduling.quartz.JobMethodInvocationFailedException:
 Invocation of method 'updateScheduledJobs' on target class [class org.custom.scheduler.SchedulerManager] failed;
 nested exception is java.lang.OutOfMemoryError: Java heap space
        at org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean$MethodInvokingJob.executeInternal(MethodInvokingJobDetailFactoryBean.java:320)
        at org.springframework.scheduling.quartz.QuartzJobBean.execute(QuartzJobBean.java:113)
        at org.quartz.core.JobRunShell.run(JobRunShell.java:223)
        at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:549)
Caused by: java.lang.OutOfMemoryError: Java heap space

2016-06-02 19:58:39,445 ERROR scheduler_Worker-6 org.quartz.core.ErrorLogger
--> Job (DEFAULT.updateScheduler threw an exception.
    org.quartz.SchedulerException: Job threw an unhandled exception. [See nested exception:
      org.springframework.scheduling.quartz.JobMethodInvocationFailedException:
      Invocation of method 'updateScheduledJobs' on target class 
zapl
  • 63,179
  • 10
  • 123
  • 154
Carx
  • 1
  • 2
  • 1
    OOM is usually fatal and a sign that the server is beyond it's limits. Continuing to operate may not be a good idea because the next issue is often right around the corner. Why is there an OOM error? Is your job allocating huge amounts of memory and memory is no longer an issue once the job failed? – zapl Jun 08 '16 at 22:32
  • yes, the job is processing a huge file, and after this, the process dies, but I need to know how to kill the job and restart the scheduler, and send the oom since this is used by many other applications. – Carx Jun 09 '16 at 00:11
  • You could for example wrap the code that tends to fail with `try { .. code .. } catch (OutOfMemoryError e)` and do whatever handling you need to do originating from the catch block. http://www.quartz-scheduler.org/documentation/quartz-2.x/examples/Example6.html I think shows how you can instruct quartz to stop or continue scheduling the same job if you need that. – zapl Jun 09 '16 at 07:55
  • I'm using quartz 1.8 – Carx Jun 09 '16 at 16:01

0 Answers0