My quartz job schedulers had a startDelay of 0 ms and a repeatInterval of 10 mins and 5 mins each. On my local environment (win/mac) and sandbox (unix) the scheduler works just fine. But in our production environment (unix), we were getting spurious java.lang.NoClassDefFoundError: Could not initialize class Foo. Now Foo was one of the many classes being called through the scheduler. In this case, I was calling a Foo.someStaticMethod.
After a whole day of debugging, this is what I found: What could be happening was that the job kicked off immediately at startup while the servlet class loader was still loading all classes and thus causing NoClassDefFoundError. Why is the scheduler unable to run after 10 mins, even though the classes should be loaded by then? I’m not sure but it could be that the failed Scheduler initialization causes repeated failed attempts with the same failed class, rather than looking up for a newly loaded class (jvm implementation?).
I added a startDelay of 6000 (1 minute) and it magically works now in all environments.
What’s surprising still is why are local envs and sandbox not having the same issues. It could be that the timing of classloader loading on local and sandbox env is a tad bit faster? I still have to figure that out …
My job schedulers had a startDelay of 0 ms and a repeatInterval of 10 mins (scheduleCertifiedAndRetryFaxes)and 5 mins (scheduleQueuedFaxes).
What could be happening was that the job kicked off immediately at startup while the servlet class loader was still loading all classes and thus causing ClassNotFoundException. Why is the scheduler
unable to run after 10 mins, even though the classes should be loaded by then? I’m not sure but it could be that the failed Scheduler initialization causes repeated failed attempts with the same failed class,
rather than looking up for a newly loaded class (jvm implementation?).
I added a startDelay of 6000 (1 minute) and it works; fax jobs are fired correctly without any issues. (local, stage)
What’s surprising still is why are local envs and sandbox not having the same issues. It could be that the timing of classloader loading on local and sandbox env is a tad bit faster? I could be wrong.
Post a Comment