Quartz Plugin

Jobs are executed before full application bootstrap and throws exception during Hibernate Session binding

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Critical Critical
  • Resolution: Fixed
  • Affects Version/s: 0.2
  • Fix Version/s: 0.3
  • Component/s: None
  • Labels:
    None

Description

When job requires bounded Hibernate Session (def sessionRequired = true ? the default behavior) the following exception is thrown during application startup.

Exception in thread "DefaultQuartzScheduler_Worker-1" java.lang.NoClassDefFoundError: org/springframework/orm/hibernate3/SessionHolder
	at org.codehaus.groovy.grails.plugins.quartz.listeners.SessionBinderJobListener.jobToBeExecuted(SessionBinderJobListener.java:49)
	at org.quartz.core.QuartzScheduler.notifyJobListenersToBeExecuted(QuartzScheduler.java:1837)
	at org.quartz.core.JobRunShell.notifyListenersBeginning(JobRunShell.java:338)
	at org.quartz.core.JobRunShell.run(JobRunShell.java:175)
	at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:529)

Looks like job tries to execute too early since specifying def startDelay = 5000 fixes the problem (consider this as a workaround).

In addition if job is not concurrent (def concurrent = false) this exception blocks it's execution and a job never becomes executed (GRAILSPLUGINS-307).

Issue Links

Activity

Hide
Sergey Nebolsin added a comment -

Fixed in rev. 41075

Show
Sergey Nebolsin added a comment - Fixed in rev. 41075

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: