Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Won't Fix
-
1.2.1
-
None
-
None
-
JBoss EAP 6.3
Description
In an application which bundles Scheduler module, if cdictrl is not manually added as a dependency to the archive, the job execution fails due to missing ContextControl class:
15:37:50,437 ERROR [org.quartz.simpl.SimpleThreadPool] (DefaultQuartzScheduler_Worker-2) Error while executing the Runnable: : java.lang.NoClassDefFoundError: org/apache/deltaspike/cdise/api/ContextControl at org.apache.deltaspike.scheduler.impl.QuartzScheduler$JobListenerContext.startContexts(QuartzScheduler.java:417) [deltaspike-scheduler-module-impl-1.2.1.jar:1.2.1] at org.apache.deltaspike.scheduler.impl.QuartzScheduler$InjectionAwareJobListener.jobToBeExecuted(QuartzScheduler.java:362) [deltaspike-scheduler-module-impl-1.2.1.jar:1.2.1] at org.quartz.core.QuartzScheduler.notifyJobListenersToBeExecuted(QuartzScheduler.java:1945) [quartz-2.2.1.jar:] at org.quartz.core.JobRunShell.notifyListenersBeginning(JobRunShell.java:324) [quartz-2.2.1.jar:] at org.quartz.core.JobRunShell.run(JobRunShell.java:173) [quartz-2.2.1.jar:] at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:573) [quartz-2.2.1.jar:]
The deltaspike-scheduler-module-impl POM has a provided dependency to deltaspike-cdictrl-api.
Ideally, the execution would only fail on CNFE if the @Scheduled(startScopes) is used.
Alternatively, the deltaspike-cdictrl-api could be compile-scoped so that it gets automatically included in the archive.
If none of this is possible, it should be documented in http://deltaspike.apache.org/documentation/scheduler.html that the cdictrl dependency always needs to be added manually.
The tests did not catch this, since they only use a mocked scheduler which does not depend on ContextControl, so the tests might need amending as well.