Win a copy of The Way of the Web Tester: A Beginner's Guide to Automating Tests this week in the Testing forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Using Spring and Quartz

Paola Orsini
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi I am new in Spring and a little bit in quartz, I am trying to do a hello world but nothing happens, I greate a web proyect with spring and struts and I want too use quartz


package example;

import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.springframework.scheduling.quartz.QuartzJobBean;

public class ExampleJob extends QuartzJobBean {

private int timeout;

* Setter called after the ExampleJob is instantiated
* with the value from the JobDetailBean (5)
public void setTimeout(int timeout) {
this.timeout = timeout;

protected void executeInternal(JobExecutionContext ctx) throws JobExecutionException {


<bean name="exampleJob" class="org.springframework.scheduling.quartz.JobDetailBean">
<property name="jobClass" value="example.ExampleJob" />
<property name="jobDataAsMap">
<entry key="timeout" value="5" />
<bean id="simpleTrigger" class="org.springframework.scheduling.quartz.SimpleTriggerBean">
<!-- see the example of method invoking job above -->
<property name="jobDetail" ref="exampleJob" />
<!-- 10 seconds -->
<property name="startDelay" value="0" />
<!-- repeat every 50 seconds -->
<property name="repeatInterval" value="5000" />
<bean class="org.springframework.scheduling.quartz.SchedulerFactoryBean">
<property name="triggers">
<ref bean="simpleTrigger" />

But nothing happens when I start the proyect(I mean the proyects starts correctly but I dont see the message), it suppones to see in console the message???
I star
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic