Women in Technology

Hear us Roar



Article:
  What Is Quartz
Subject:   Problem with using Quartz
Date:   2005-10-25 08:09:05
From:   bonzai
Hi there,
I've read this article and am trying to deploy a simple web app to test Quartz. I've got a simple Java class that implements org.quartz.Job. All it does is send an email. I would like to take the XML approach for setting up the scheduler. Following your example, I've created a myjob.xml. My myjob.xml looks like the following:


?xml version='1.0' encoding='utf-8'?>
<quartz>
<job>
<job-detail>
<name>TestJob</name>
<description> A job that sends mail
</description>
<job-class>net.uu.za.Quartz.TestJob</job-class>
<job-data-map allows-transient-data="true">
<entry>
<key>SendMail</key>
<value>Testing Quartz</value>
</entry>

<!-- Other neccessary Job parameters here -->


</job-data-map>
</job-detail>


<trigger>
<simple>
<name>SendMailJobTrigger</name>
<job-name>TestJob</job-name>
<start-time>2005-10-25 4:38:00 PM</start-time>
<end-time>2005-10-25 4:40:00 PM</end-time>
</simple>
</trigger>
</job>
</quartz>


And in my quartz.properties, I've added configuration for plugins: as follows:


org.quartz.plugin.triggHistory.class = org.quartz.plugins.history.LoggingTriggerHistoryPlugin
org.quartz.plugin.triggHistory.triggerFiredMessage = Trigger {1}.{0} fired job {6}.{5} at: {4, date, HH:mm:ss MM/dd/yyyy}
org.quartz.plugin.triggHistory.triggerCompleteMessage = Trigger {1}.{0} completed firing job {6}.{5} at {4, date, HH:mm:ss MM/dd/yyyy} with resulting trigger instruction code: {9}


org.quartz.plugin.jobInitializer.class = org.quartz.plugins.xml.JobInitializationPlugin
org.quartz.plugin.jobInitializer.fileName = \myjob.xml
org.quartz.plugin.jobInitializer.overWriteExistingJobs = false
org.quartz.plugin.jobInitializer.failOnFileNotFound = true


org.quartz.plugin.shutdownhook.class = org.quartz.plugins.management.ShutdownHookPlugin
org.quartz.plugin.shutdownhook.cleanShutdown = true


I can successfully build and deploy this simple web app. But nothing happens, nor did I get any error messages. I have a few questions:


1. Must I store both the quartz.properties file and myjob.xml under /WEB-INF/classes?


2. Is my declaration for "org.quartz.plugin.jobInitializer.fileName" field in my quartz.properties correct? (If the path is in point 1)


3. Is it correct that I must give the full path to my send mail Java class under <job-class>net.uu.za.Quartz.TestJob</job-class>
in myjob.xml?


4. If my settings and paths are correct, the scheduler should be able to read the job and the trigger,and then send email in the background, correct?


If my info is too vague, please kindly let me know. Also, if you could point me to any tips on debugging this, I'd really appreciate it.


Thanks in advance.

Full Threads Oldest First

Showing messages 1 through 6 of 6.

  • Problem with using Quartz
    2006-11-28 23:16:27  Anns [View]

    I am a begginner in quartz development.i am doing a scheduler with few jobs running.Now i got struck with send mail job.can u send me the send mail prgram done by u.
    • Problem with using Quartz
      2006-12-12 05:30:58  motivation [View]

      I could easily mail u the send mail prgram done by me.Actually , i am also new to quartz.I require some help regarding quartz, can u send me the code for scheduler with few jobs running.so taking that example i want to implement auto-generated reminders in my project,so that i can send u the same
  • Problem with using Quartz
    2005-10-25 11:11:24  Chuck Cavaness | O'Reilly Author [View]

    There are several things to check. First, how are you starting the Quartz Scheduler? The Scheduler acts like a service and needs to be started in order to load and schedule Jobs.

    The best advice that I can give is to point you to the draft chapters of the book that I'm writing on Quartz. You can find the draft chapters on the main Quartz site: http://www.opensymphony.com/quartz/book_chaps.html.

    Chapter 13 covers using Quartz inside a web application. Quartz can be started and ran from a web application fine, but there are some steps that must be taken because it is a web app and runs within a web container. For you first Quartz app, you might consider running it as a stand alone J2SE application. It will be easier to understand. There are several chapters out there that will help you better understand the framework.

    chuck
    • Problem with using Quartz
      2005-10-26 00:36:47  bonzai [View]

      Hi Chuck,

      Thanks for your prompt reply, I will look at the draft chapters.
      • Problem with using Quartz
        2007-03-26 22:09:13  Hapi [View]

        Hi ,
        I want sample Quartz with web application and jobListener example. Please forward sample code to my personal email id.
        Email-id pattanaikhr@gmail.com

        Regards
        Hapi
        India
      • Problem with using Quartz
        2006-12-09 14:00:28  tsmets [View]


        Draft chapters are not available anymore ...
        Any idea where they can be find ... ?

        \T,