<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
	<channel>
		<title><![CDATA[Latest posts for the topic "Misfire Instruction not working in quartz 1.8.3 using XML"]]></title>
		<link>http://forums.terracotta.org/forums/posts/list/17.page</link>
		<description><![CDATA[Latest messages posted in the topic "Misfire Instruction not working in quartz 1.8.3 using XML"]]></description>
		<generator>JForum - http://www.jforum.net</generator>
			<item>
				<title>Misfire Instruction not working in quartz 1.8.3 using XML</title>
				<description><![CDATA[ I am using the current xml file to trigger the jobs. But I'm not able to handle the misfires using this code. If I miss a firing because of the server shutdown, it should fire once the server is back on. The version of quartz is 1.8.3 and I cannot use the latest version where I can use the MISFIRE_INSTRUCTION_IGNORE_MISFIRE_POLICY in version 2.0 and higher to do the job. Is something wrong with the code ? I'm using the JDBCJobStore.


<span class="genmed"><b>Code:</b></span><br>
		<div>
		<pre bbCodeId="pre-code" style="overflow: auto; width: 95%; max-height: 350px; height:expression(this.scrollHeight > 350 ? '350px' : 'auto');">
&lt;?xml version='1.0' encoding='utf-8'?&gt;
&lt;job-scheduling-data xmlns="http://www.quartz-scheduler.org/xml/JobSchedulingData"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://www.quartz-scheduler.org/xml/JobSchedulingData http://www.quartz-scheduler.org/xml/job_scheduling_data_1_8.xsd"
  version="1.8"&gt;
&lt;pre-processing-commands&gt;
&lt;/pre-processing-commands&gt;

&lt;processing-directives&gt;
    &lt;overwrite-existing-data&gt;true&lt;/overwrite-existing-data&gt;
    &lt;ignore-duplicates&gt;false&lt;/ignore-duplicates&gt; 
&lt;/processing-directives&gt;

&lt;schedule&gt;

    &lt;job&gt;
        &lt;name&gt;NotificationJob&lt;/name&gt;
        &lt;group&gt;MONTHLY_PGWEBSITE_JOBS&lt;/group&gt;
        &lt;description&gt;something&lt;/description&gt;
        &lt;job-class&gt;ClientNotificationJob&lt;/job-class&gt;
        &lt;volatility&gt;false&lt;/volatility&gt; 
        &lt;durability&gt;false&lt;/durability&gt;
        &lt;recover&gt;true&lt;/recover&gt;
        &lt;job-data-map&gt;
            &lt;entry&gt;
                &lt;key&gt;notificationType&lt;/key&gt;
                &lt;value&gt;BSEM&lt;/value&gt;
            &lt;/entry&gt;
        &lt;/job-data-map&gt;
    &lt;/job&gt;

    &lt;trigger&gt;
        &lt;cron&gt;  
            &lt;name&gt;billing_statements_email_trigger&lt;/name&gt;  
            &lt;group&gt;MONTHLY_PGWEBSITE_TRIGGERS&lt;/group&gt;  
            &lt;job-name&gt;clientBS_NotificationJob&lt;/job-name&gt;  
            &lt;job-group&gt;MONTHLY_PGWEBSITE_JOBS&lt;/job-group&gt;
            &lt;volatility&gt;false&lt;/volatility&gt; 
            &lt;misfire-instruction&gt;MISFIRE_INSTRUCTION_FIRE_ONCE_NOW&lt;/misfire-instruction&gt;
            &lt;cron-expression&gt;0 0 14 * * ?&lt;/cron-expression&gt;  
        &lt;/cron&gt;
    &lt;/trigger&gt;  
&lt;/schedule&gt;
&lt;/job-scheduling-data&gt;
</pre>
		</div>


I tried removing the <overwrite-existing-data> tag, but did not work.

Quartz-service.xml file 
<span class="genmed"><b>Code:</b></span><br>
		<div>
		<pre bbCodeId="pre-code" style="overflow: auto; width: 95%; max-height: 350px; height:expression(this.scrollHeight > 350 ? '350px' : 'auto');">
&lt;attribute name="Properties"&gt;
		#============================================================================
		# Configure Main Scheduler Properties  
		#============================================================================

		org.quartz.scheduler.instanceName = MyQuartzSchedulerLOCAL
		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.impl.jdbcjobstore.JobStoreTX
		org.quartz.jobStore.driverDelegateClass = org.quartz.impl.jdbcjobstore.MSSQLDelegate
		org.quartz.jobStore.useProperties = true

		org.quartz.jobStore.tablePrefix = QRTZ_
		org.quartz.jobStore.isClustered = true
		org.quartz.jobStore.clusterCheckinInterval = 20000

		#============================================================================
		# Configure Datasources  
		#============================================================================
		org.quartz.jobStore.dataSource = csBatch
		org.quartz.dataSource.csBatch.jndiURL = java:csBatchDS
     
		#============================================================================
		# Configure Plugins  
		#============================================================================
		
		org.quartz.plugin.jobInitializer.class = org.quartz.plugins.xml.XMLSchedulingDataProcessorPlugin
		org.quartz.plugin.jobInitializer.fileNames = batch_jobs.xml
		org.quartz.plugin.jobInitializer.failOnFileNotFound = true
		org.quartz.plugin.jobInitializer.wrapInUserTransaction = false
    &lt;/attribute&gt;
</pre>
		</div>]]></description>
				<guid isPermaLink="true">http://forums.terracotta.org/forums/posts/list/6353.page#32244</guid>
				<link>http://forums.terracotta.org/forums/posts/list/6353.page#32244</link>
				<pubDate><![CDATA[Tue, 6 Dec 2011 12:12:47]]> GMT</pubDate>
				<author><![CDATA[ bnchary]]></author>
			</item>
			<item>
				<title>Re:Misfire Instruction not working in quartz 1.8.3 using XML</title>
				<description><![CDATA[ So your schedule settings in question are:
<span class="genmed"><b>Code:</b></span><br>
		<div>
		<pre bbCodeId="pre-code" style="overflow: auto; width: 95%; max-height: 350px; height:expression(this.scrollHeight > 350 ? '350px' : 'auto');">
             &lt;misfire-instruction&gt;MISFIRE_INSTRUCTION_FIRE_ONCE_NOW&lt;/misfire-instruction&gt;
             &lt;cron-expression&gt;0 0 14 * * ?&lt;/cron-expression&gt;  
</pre>
		</div>

This means fire every day at 2:00 PM.  So you have tested the following way:

Start the application before 2:00 PM, so that the xml file is read, and the trigger is added to the jobstore.

Shut down the application before 2:00 PM.

Leave the application down until after 2:00 PM + configured misfire threshold = 2:01 PM.

Remove the XML file, or change these settings in the XML (to avoid error when it encounters the xml command to add a trigger that already exists, and to avoid it replacing the trigger with a new one that is therefore not misfired, because it didn't exist at 2:00 PM):

change:
<span class="genmed"><b>Code:</b></span><br>
		<div>
		<pre bbCodeId="pre-code" style="overflow: auto; width: 95%; max-height: 350px; height:expression(this.scrollHeight > 350 ? '350px' : 'auto');">
 &lt;processing-directives&gt;
     &lt;overwrite-existing-data&gt;true&lt;/overwrite-existing-data&gt;
     &lt;ignore-duplicates&gt;false&lt;/ignore-duplicates&gt; 
 &lt;/processing-directives&gt;
</pre>
		</div>

to:
<span class="genmed"><b>Code:</b></span><br>
		<div>
		<pre bbCodeId="pre-code" style="overflow: auto; width: 95%; max-height: 350px; height:expression(this.scrollHeight > 350 ? '350px' : 'auto');">
 &lt;processing-directives&gt;
     &lt;overwrite-existing-data&gt;false&lt;/overwrite-existing-data&gt;
     &lt;ignore-duplicates&gt;true&lt;/ignore-duplicates&gt; 
 &lt;/processing-directives&gt;
</pre>
		</div>

Start the server, and see that the trigger scheduled before 2:00 PM for 2:00 PM fires now.
]]></description>
				<guid isPermaLink="true">http://forums.terracotta.org/forums/posts/list/6353.page#32247</guid>
				<link>http://forums.terracotta.org/forums/posts/list/6353.page#32247</link>
				<pubDate><![CDATA[Tue, 6 Dec 2011 13:35:17]]> GMT</pubDate>
				<author><![CDATA[ jhouse]]></author>
			</item>
			<item>
				<title>Re:Misfire Instruction not working in quartz 1.8.3 using XML</title>
				<description><![CDATA[ Thanks for the prompt reply.

Here is the scenario I have tested. I changed the cron trigger to fire every 10 min. I changed the Xml file as suggested, load the application, stop the server before firing time(suppose 3pm). Then when I have started the server at 3:05 pm, it is going to infinite loop as 

<span class="genmed"><b>Code:</b></span><br>
		<div>
		<pre bbCodeId="pre-code" style="overflow: auto; width: 95%; max-height: 350px; height:expression(this.scrollHeight > 350 ? '350px' : 'auto');">
15:01:38,937 INFO  &#91;StdSchedulerFactory&#93; Quartz scheduler 'MyQuartzSchedulerLOCAL' initialized from an externally provided properties instance.
15:01:38,937 INFO  &#91;StdSchedulerFactory&#93; Quartz scheduler version: 1.8.3
15:01:39,078 INFO  &#91;JobStoreTX&#93; ClusterManager: detected 1 failed or restarted instances.
15:01:39,078 INFO  &#91;JobStoreTX&#93; ClusterManager: Scanning for instance "0WS3016801323208730375"'s failed in-progress jobs.
15:01:39,140 INFO  &#91;JobStoreTX&#93; Handling 1 trigger&#40;s&#41; that missed their scheduled fire-time.
15:01:39,140 INFO  &#91;XMLSchedulingDataProcessor&#93; Parsing XML file: batch_jobs.xml with systemId: batch_jobs.xml
15:01:39,281 INFO  &#91;XMLSchedulingDataProcessor&#93; Adding 1 jobs, 1 triggers.
15:01:39,296 INFO  &#91;XMLSchedulingDataProcessor&#93; Not overwriting existing job: MONTHLY_PGWEBSITE_JOBS.clientBS_NotificationJob
15:01:39,296 INFO  &#91;XMLSchedulingDataProcessor&#93; Not overwriting existing trigger: MONTHLY_PGWEBSITE_TRIGGERS.billing_statements_email_trigger
15:01:39,312 INFO  &#91;XMLSchedulingDataProcessor&#93; Not overwriting existing trigger: MONTHLY_PGWEBSITE_TRIGGERS.billing_statements_email_trigger
15:01:39,312 INFO  &#91;XMLSchedulingDataProcessor&#93; Not overwriting existing trigger: MONTHLY_PGWEBSITE_TRIGGERS.billing_statements_email_trigger
15:01:39,328 INFO  &#91;XMLSchedulingDataProcessor&#93; Not overwriting existing trigger: MONTHLY_PGWEBSITE_TRIGGERS.billing_statements_email_trigger
15:01:39,328 INFO  &#91;XMLSchedulingDataProcessor&#93; Not overwriting existing trigger: MONTHLY_PGWEBSITE_TRIGGERS.billing_statements_email_trigger
15:01:39,343 INFO  &#91;XMLSchedulingDataProcessor&#93; Not overwriting existing trigger: MONTHLY_PGWEBSITE_TRIGGERS.billing_statements_email_trigger
15:01:39,343 INFO  &#91;XMLSchedulingDataProcessor&#93; Not overwriting existing trigger: MONTHLY_PGWEBSITE_TRIGGERS.billing_statements_email_trigger
15:01:39,359 INFO  &#91;XMLSchedulingDataProcessor&#93; Not overwriting existing trigger: MONTHLY_PGWEBSITE_TRIGGERS.billing_statements_email_trigger
15:01:39,359 INFO  &#91;XMLSchedulingDataProcessor&#93; Not overwriting existing trigger: MONTHLY_PGWEBSITE_TRIGGERS.billing_statements_email_trigger
15:01:39,375 INFO  &#91;XMLSchedulingDataProcessor&#93; Not overwriting existing trigger: MONTHLY_PGWEBSITE_TRIGGERS.billing_statements_email_trigger
15:01:39,375 INFO  &#91;XMLSchedulingDataProcessor&#93; Not overwriting existing trigger: MONTHLY_PGWEBSITE_TRIGGERS.billing_statements_email_trigger
15:01:39,375 INFO  &#91;XMLSchedulingDataProcessor&#93; Not overwriting existing trigger: MONTHLY_PGWEBSITE_TRIGGERS.billing_statements_email_trigger
15:01:39,406 INFO  &#91;XMLSchedulingDataProcessor&#93; Not overwriting existing trigger: MONTHLY_PGWEBSITE_TRIGGERS.billing_statements_email_trigger
.........
</pre>
		</div>


]]></description>
				<guid isPermaLink="true">http://forums.terracotta.org/forums/posts/list/6353.page#32248</guid>
				<link>http://forums.terracotta.org/forums/posts/list/6353.page#32248</link>
				<pubDate><![CDATA[Tue, 6 Dec 2011 14:08:28]]> GMT</pubDate>
				<author><![CDATA[ bnchary]]></author>
			</item>
			<item>
				<title>Re:Misfire Instruction not working in quartz 1.8.3 using XML</title>
				<description><![CDATA[ Hello bnchary,

The infinite loop problem you have seen here is a bug, and it's been fixed in 1.8.6, but it's not release yet.

http://jira.terracotta.org/jira/browse/QTZ-187

This is already fixed in quartz-2.1.0 or higher though.]]></description>
				<guid isPermaLink="true">http://forums.terracotta.org/forums/posts/list/6353.page#32251</guid>
				<link>http://forums.terracotta.org/forums/posts/list/6353.page#32251</link>
				<pubDate><![CDATA[Tue, 6 Dec 2011 18:54:33]]> GMT</pubDate>
				<author><![CDATA[ light5]]></author>
			</item>
			<item>
				<title>Misfire Instruction not working in quartz 1.8.3 using XML</title>
				<description><![CDATA[ We are also getting same exception about recover batch job, I did the setting as below and it is working fine            

 <processing-directives>
      <overwrite-existing-data>false</overwrite-existing-data>
      <ignore-duplicates>true</ignore-duplicates> 
  </processing-directives>


But I have one question here, how to load updated job in DB, now we have set 
<overwrite-existing-data> flag as false ,so it will never take the updated batch job like if there is any xml change for existing batch job. 

How to handle this?
]]></description>
				<guid isPermaLink="true">http://forums.terracotta.org/forums/posts/list/6353.page#38446</guid>
				<link>http://forums.terracotta.org/forums/posts/list/6353.page#38446</link>
				<pubDate><![CDATA[Wed, 13 Feb 2013 22:59:29]]> GMT</pubDate>
				<author><![CDATA[ DAG87001]]></author>
			</item>
	</channel>
</rss>