Hi,
I am using Spring 1.2. I tried a simple job scheduling by reading
http://static.springframework.org/sp...cheduling.html
Basically, I have written a simple class that extends QuartzJobBean.
And I have specified the spring beans as -Code:package example; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.quartz.JobExecutionContext; import org.quartz.JobExecutionException; import org.springframework.scheduling.quartz.QuartzJobBean; /** * @author Vaibhav Mishra */ public class QuartzSample extends QuartzJobBean { /** * logger for this class */ private Log log = LogFactory.getLog(QuartzSample.class); /* * (non-Javadoc) * * @see org.springframework.scheduling.quartz.QuartzJobBean * #executeInternal(org.quartz.JobExecutionContext) */ @Override protected void executeInternal(JobExecutionContext arg0) throws JobExecutionException { log.error("Sample job executed using Quartz."); } }
I have my application deployed in JBoss 4.0.2.Code:<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd"> <beans> <bean name="sampleJob" class="org.springframework.scheduling.quartz.JobDetailBean"> <property name="jobClass" value="example.QuartzSample" /> </bean> <bean id="cronTrigger" class="org.springframework.scheduling.quartz.CronTriggerBean"> <property name="jobDetail" ref="sampleJob" /> <!-- s m h d M [y] current setting 6:20 pm --> <property name="cronExpression" value="0 20 18 * * ?" /> </bean> <bean id="schedulerFactory" class="org.springframework.scheduling.quartz.SchedulerFactoryBean"> <property name="autoStartup" value="true" /> <property name="triggers"> <list> <ref bean="cronTrigger" /> </list> </property> </bean> </beans>
JBoss restarts without any exception, but the things does not seems to be working. I even get the following line printed on JBoss console -
But, job does not run at scheduled time.Code:11:56:26,187 INFO [QuartzScheduler] Scheduler QuartzScheduler_$_NON_CLUSTERED started.
Please help.
Regards,
Vaibhav


Reply With Quote