Click here to Skip to main content
15,886,873 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have used the quartz.net for scheduling the job. However, when I run the code, it is showing the error "SchedulerPlugin of type 'Quartz.Plugin.Xml.JobInitializationPlugin, Quartz' could not be instantiated".

Here the code

C#
static void Main(string[] args)
       {

           IScheduler _scheduler = null;
           // start up scheduler`enter code here`
           // construct a factory `enter code here`
           ISchedulerFactory factory = new StdSchedulerFactory();
           // get a scheduler
           _scheduler = factory.GetScheduler();
           // start the scheduler
           _scheduler.Start();

           Console.ReadLine();
       }



This the app.config file


HTML
<configSections>
    <section name="quartz" type="System.Configuration.NameValueSectionHandler, System, Version=1.0.5000.0,Culture=neutral, PublicKeyToken=b77a5c561934e089" />
  </configSections>
  <quartz>
    <add key="quartz.scheduler.instanceName" value="QuartzScheduler" />
    <!-- Configure Thread Pool -->
    <add key="quartz.threadPool.type" value="Quartz.Simpl.SimpleThreadPool, Quartz" />
    <add key="quartz.threadPool.threadCount" value="10" />
    <add key="quartz.threadPool.threadPriority" value="Normal" />
    <!-- Configure Job Store -->
    <add key="quartz.jobStore.type" value="Quartz.Simpl.RAMJobStore, Quartz" />
    <add key="quartz.plugin.xml.type" value="Quartz.Plugin.Xml.JobInitializationPlugin, Quartz" />
    <add key="quartz.plugin.xml.fileNames" value="~/quartzjobs.config" />
  </quartz>


and this is the quartzjobs.config file

XML
<?xml version="1.0" encoding="UTF-8"?>
   <quartz xmlns="http://quartznet.sourceforge.net/JobSchedulingData"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.0" overwrite-existing-jobs="true">

     <job>
       <job-detail>
         <name>MyJob</name>
         <group>MyJobs</group>
         <description>Logs a message to the application log</description>
         <job-type>Sample.MyJob, Sample</job-type>
         <volatile>false</volatile>
         <durable>true</durable>
         <recover>false</recover>
         <job-data-map>
           <entry>
             <key>MessageToLog</key>
             <value>Hello from MyJob</value>
           </entry>
         </job-data-map>
       </job-detail>
       <trigger>
         <cron>
           <name>MyJobTrigger</name>
           <group>MyJobs</group>
           <description>A description</description>
           <job-name>MyJob</job-name>
           <job-group>MyJobs</job-group>
           <cron-expression>0 0/1 * * * ?</cron-expression>
         </cron>
       </trigger>
     </job>

   </quartz>
Posted
Updated 23-Jul-12 15:21pm
v2

You need to replace JobInitializationPlugin with XMLSchedulingDataProcessorPlugin. Since version 1.8 the class of the plugin has been updated. More information is available here: http://quartz-scheduler.org/documentation/quartz-2.x/cookbook/JobInitPlugin[^]
 
Share this answer
 
Comments
jfranzone 13-Sep-12 10:54am    
Thanks!
How about going to the site where you got this control and asking the people who wrote it this question instead of asking a bunch of people who have never heard of it?
 
Share this answer
 
Comments
Hans Baldetorp 7-Apr-12 9:07am    
Very useful answer...
Dave Kreskowiak 7-Apr-12 9:36am    
Yeah, and some asshat still voted the answer a 1. I really don't care about the value of the vote, but it does make me question why I even bother at times...
Alexander Siniouguine 23-Jul-12 21:14pm    
It deserves a 1, the component is well known and is a valid and well described question.
Dave Kreskowiak 23-Jul-12 22:28pm    
Never heard of it. Nor has anyone else I work with.
jfranzone 13-Sep-12 10:53am    
Just because you've never used something and don't know what it is does not mean that it is not valid. I have been using Quartz.NET for several years and recently ran across this very same problem. And lo and behold somebody on here had the issue as well.
You must run in application pool ASP.NET 4.0 Classic
 
Share this answer
 
I found this description at github repo

JobInitializationPlugin is now deprecated in favor of XMLSchedulingDataProcessorPlugin, JobInitializationPlugin no longer included

https://github.com/quartznet/quartznet/search?utf8=%E2%9C%93&q=JobInitializationPlugin&type=Code[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900