You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<pre-processing-commands>
<delete-jobs-in-group>*</delete-jobs-in-group> <!-- clear all jobs in scheduler -->
<delete-triggers-in-group>*</delete-triggers-in-group> <!-- clear all triggers in scheduler -->
</pre-processing-commands>
<processing-directives>
<!-- if there are any jobs/trigger in scheduler of same name (as in this file), overwrite them -->
<overwrite-existing-data>true</overwrite-existing-data>
<!-- if there are any jobs/trigger in scheduler of same name (as in this file), and over-write is false, ignore them rather then generating an error -->
<ignore-duplicates>false</ignore-duplicates>
</processing-directives>
<schedule>
<job>
<name>Empty</name>
<description>Esempio di job</description>
<job-class>it.exis.medals_platform.jobs.JobWorker</job-class>
</job>
<trigger>
<cron>
<name>TriggerEmpty</name>
<job-name>Empty</job-name>
<cron-expression>0 30 03 ? * * *</cron-expression>
</cron>
</trigger>
</schedule>
finaly my JobWorker class:
package it.exis.medals_platform.jobs;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
public class JobWorker implements Job
{
@Override
public void execute(JobExecutionContext context) throws JobExecutionException {
System.out.println("Hello World!");
int a = 6/0;
}
}
The web app is deployed on tomcat 10.0, and when the server started I see:
`main] INFO org.quartz.ee.servlet.QuartzInitializerListener - Quartz Initializer Servlet loaded, initializing Scheduler...
[main] INFO org.quartz.impl.StdSchedulerFactory - Using default implementation for ThreadExecutor
[main] INFO org.quartz.core.SchedulerSignalerImpl - Initialized Scheduler Signaller of type: class org.quartz.core.SchedulerSignalerImpl
[main] INFO org.quartz.core.QuartzScheduler - Quartz Scheduler v.2.3.2 created.
[main] INFO org.quartz.plugins.xml.XMLSchedulingDataProcessorPlugin - Registering Quartz Job Initialization Plug-in.
[main] INFO org.quartz.simpl.RAMJobStore - RAMJobStore initialized.
[main] INFO org.quartz.core.QuartzScheduler - Scheduler meta-data: Quartz Scheduler (v2.3.2) 'QuartzScheduler' with instanceId 'NON_CLUSTERED'
Scheduler class: 'org.quartz.core.QuartzScheduler' - running locally.
NOT STARTED.
Currently in standby mode.
Number of jobs executed: 0
Using thread pool 'org.quartz.simpl.SimpleThreadPool' - with 3 threads.
Using job-store 'org.quartz.simpl.RAMJobStore' - which does not support persistence. and is not clustered.
[main] INFO org.quartz.impl.StdSchedulerFactory - Quartz scheduler 'QuartzScheduler' initialized from default resource file in Quartz package: 'quartz.properties'
[main] INFO org.quartz.impl.StdSchedulerFactory - Quartz scheduler version: 2.3.2
[main] INFO org.quartz.xml.XMLSchedulingDataProcessor - Parsing XML file: quartz_data.xml with systemId: quartz_data.xml
[main] INFO org.quartz.xml.XMLSchedulingDataProcessor - Deleting all jobs in ALL groups.
[main] INFO org.quartz.xml.XMLSchedulingDataProcessor - Deleting all triggers in ALL groups.
[main] INFO org.quartz.xml.XMLSchedulingDataProcessor - Adding 1 jobs, 1 triggers.
[main] INFO org.quartz.xml.XMLSchedulingDataProcessor - Adding job: DEFAULT.Empty
[main] INFO org.quartz.core.QuartzScheduler - Scheduler QuartzScheduler_$_NON_CLUSTERED started.
[main] INFO org.quartz.ee.servlet.QuartzInitializerListener - Scheduler has been started...
[main] INFO org.quartz.ee.servlet.QuartzInitializerListener - Storing the Quartz Scheduler Factory in the servlet context at key: org.quartz.impl.StdSchedulerFactory.KEY
[QuartzScheduler_Worker-1] INFO org.quartz.plugins.history.LoggingJobHistoryPlugin - Job JobSchedulingDataLoaderPlugin.JobSchedulingDataLoaderPlugin_jobInitializer_quartz_data_xml fired (by trigger JobSchedulingDataLoaderPlugin.JobSchedulingDataLoaderPlugin_jobInitializer_quartz_data_xml) at: 16:50:06 04/01/2025
[QuartzScheduler_Worker-1] INFO org.quartz.plugins.history.LoggingJobHistoryPlugin - Job JobSchedulingDataLoaderPlugin.JobSchedulingDataLoaderPlugin_jobInitializer_quartz_data_xml execution complete at 16:50:06 04/01/2025 and reports: null
apr 01, 2025 4:50:07 PM org.glassfish.jersey.server.wadl.WadlFeature configure`
But there is not Hello world printed and also there is not the exeception caused by "int a = 6/0;"
It seems that the job Empty has not been launched at all while another job tha do nothing is launched, and I cannot figure out what I miss. Any help really appreciated.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
I have a web application and I want to run a job every 2 minute, so I have configured it in this way:
In pom.xml
In my web.xml:
my quartz.properties
`#============================================================================
Configure Main Scheduler Properties
#============================================================================
org.quartz.scheduler.instanceName= QuartzScheduler
org.quartz.scheduler.instanceId= AUTO
org.quartz.scheduler.skipUpdateCheck= true
#============================================================================
Configure ThreadPool
#============================================================================
org.quartz.threadPool.class= org.quartz.simpl.SimpleThreadPool
org.quartz.threadPool.threadCount= 3
org.quartz.threadPool.threadPriority= 5
#============================================================================
Configure JobStore
#============================================================================
org.quartz.jobStore.misfireThreshold= 60000
org.quartz.jobStore.class= org.quartz.simpl.RAMJobStore
#============================================================================
Configure Plugins
#============================================================================
org.quartz.plugin.jobInitializer.fileNames= quartz_data.xml
org.quartz.plugin.triggHistory.class= org.quartz.plugins.history.LoggingJobHistoryPlugin
org.quartz.plugin.jobInitializer.class= org.quartz.plugins.xml.XMLSchedulingDataProcessorPlugin
org.quartz.plugin.jobInitializer.failOnFileNotFound= true
org.quartz.plugin.jobInitializer.scanInterval= 120
org.quartz.plugin.jobInitializer.wrapInUserTransaction= false`
and my quartz_data.xml
finaly my JobWorker class:
The web app is deployed on tomcat 10.0, and when the server started I see:
But there is not Hello world printed and also there is not the exeception caused by "int a = 6/0;"
It seems that the job Empty has not been launched at all while another job tha do nothing is launched, and I cannot figure out what I miss. Any help really appreciated.
Beta Was this translation helpful? Give feedback.
All reactions