quartz-scheduler / quartz

Code for Quartz Scheduler
http://www.quartz-scheduler.org
Apache License 2.0
6.3k stars 1.94k forks source link

2.5.0-RC1: ClassCastException: org.quartz.plugins.xml.XMLSchedulingDataProcessorPlugin cannot be cast to org.quartz.jobs.FileScanListener #1125

Closed cstsw closed 1 month ago

cstsw commented 6 months ago

I'm trying to port our quartz jobs to a recent version of Wildfly (31 under Java 17) and get the following error for a job declared in an XML-file:

ERROR [org.quartz.core.JobRunShell] Job JobSchedulingDataLoaderPlugin.JobSchedulingDataLoaderPlugin_jobInitializer_hfdb-metax-schedule_xml threw an unhandled Exception: : java.lang.ClassCastException: class org.quartz.plugins.xml.XMLSchedulingDataProcessorPlugin cannot be cast to class org.quartz.jobs.FileScanListener (org.quartz.plugins.xml.XMLSchedulingDataProcessorPlugin and org.quartz.jobs.FileScanListener are in unnamed module of loader 'org.quartz@2.5.0-rc1' @1b4c3620) at org.quartz@2.5.0-rc1//org.quartz.plugins.xml.FileScanJob.execute(FileScanJob.java:101) at org.quartz@2.5.0-rc1//org.quartz.core.JobRunShell.run(JobRunShell.java:202) at org.quartz@2.5.0-rc1//org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:573)

Some background:

My questions are:

cstsw commented 6 months ago

A quick follow-up: the issue regarding the FileScanListener was (probably unintendedly) introduced in commit 6f37e295eeb474a2beb4d48e893014903599e703: since that commit the class XMLSchedulingDataProcessorPlugin implements org.quartz.plugins.xml.FileScanListener whereas formerly it implemented org.quartz.jobs.FileScanListener. Hence, the ClassCastException as printed in the stacktrace in the post above occurs when using quartz jobs defined in XML-files.

j-blandford commented 4 months ago

Same issue here. Our logs have been destroyed by this!

jhouserizer commented 1 month ago

I'm working on a fix for this.

j-blandford commented 1 month ago

Thank you @jhouserizer !