0

i am using quartz scheduling in web application on my class SchedulerJob i am fetching data fro DB and setting some fields based on some condition but i am getting the following error

org.quartz.SchedulerException: JobStore class 'org.quartz.simpl.RAMJobStore' props could not be configured. [See nested exception: java.lang.NoSuchMethodException: No setter for  property 'driverDelegateClass,']

i have quartz.properties file in which i have defined RAM JOB like

org.quartz.threadPool.class = org.quartz.simpl.SimpleThreadPool
org.quartz.threadPool.threadCount = 10
org.quartz.threadPool.threadPriority = 5
org.quartz.threadPool.threadsInheritContextClassLoaderOfInitializingThread = true
org.quartz.jobStore.tablePrefix, 
org.quartz.jobStore.driverDelegateClass, 
org.quartz.jobStore.dataSource
org.quartz.jobStore.class = org.quartz.simpl.RAMJobStore

my classes are

public class QuartzSchedulerListener implements ServletContextListener {

public void contextDestroyed(ServletContextEvent arg0) {
    //
}

public void contextInitialized(ServletContextEvent arg0) {

    JobDetail job = JobBuilder.newJob(SchedulerJob.class)
        .withIdentity("anyJobName", "group1").build();

    try {

        Trigger trigger = TriggerBuilder
          .newTrigger()
          .withIdentity("anyTriggerName", "group1")
          .withSchedule(
             CronScheduleBuilder.cronSchedule("0/10 * * * * ?"))
          .build();

        Scheduler scheduler = new StdSchedulerFactory().getScheduler();
        scheduler.start();
        scheduler.scheduleJob(job, trigger);

    } catch (SchedulerException e) {
        e.printStackTrace();
    }

}

}

which is firing every 10 seconds

and a SchedulerJob doing the job like

public class SchedulerJob implements Job { private static final Logger LOGGER = LoggerFactory.getLogger(SchedulerJob.class);

@EJB
private Iinterface service;


public void execute(JobExecutionContext context)
    throws JobExecutionException {

    // fetch list from DB
    List<SampleClass> list= new ArrayList<SampleClass>();
    try {

        list= service.getData();
        LOGGER.info("after action cron");
    } catch (Exception e) {
        LOGGER.info("exception action cron");
        e.printStackTrace();
    } 

    DO some operation and update on this list


    System.out.println("Struts 2.3.4 + Quartz 2.1.5");

}

}

This is the full stack trace

[#|2013-05-20T23:36:32.132+0530|SEVERE|glassfish3.1.2|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=10;_ThreadName=Thread-2;|org.quartz.SchedulerException: JobStore class 'org.quartz.simpl.RAMJobStore' props could not be configured. [See nested exception: java.lang.NoSuchMethodException: No setter for property 'driverDelegateClass,']
at org.quartz.impl.StdSchedulerFactory.instantiate(StdSchedulerFactory.java:874)
at org.quartz.impl.StdSchedulerFactory.getScheduler(StdSchedulerFactory.java:1502)
at org.apache.catalina.core.StandardContext.contextListenerStart(StandardContext.java:4750)
at com.sun.enterprise.web.WebModule.contextListenerStart(WebModule.java:550)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:5366)
at com.sun.enterprise.web.WebModule.start(WebModule.java:498)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:917)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:901)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:733)
at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:2019)
at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:1669)
at com.sun.enterprise.web.WebApplication.start(WebApplication.java:109)
at org.glassfish.internal.data.EngineRef.start(EngineRef.java:130)
at org.glassfish.internal.data.ModuleInfo.start(ModuleInfo.java:269)
at org.glassfish.internal.data.ApplicationInfo.start(ApplicationInfo.java:301)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:461)
at com.sun.enterprise.v3.server.ApplicationLoaderService.processApplication(ApplicationLoaderService.java:375)
at com.sun.enterprise.v3.server.ApplicationLoaderService.postConstruct(ApplicationLoaderService.java:219)
at com.sun.hk2.component.AbstractCreatorImpl.inject(AbstractCreatorImpl.java:131)
at com.sun.hk2.component.ConstructorCreator.initialize(ConstructorCreator.java:91)
at com.sun.hk2.component.AbstractCreatorImpl.get(AbstractCreatorImpl.java:82)
at com.sun.hk2.component.SingletonInhabitant.get(SingletonInhabitant.java:67)
at com.sun.hk2.component.EventPublishingInhabitant.get(EventPublishingInhabitant.java:139)
at com.sun.hk2.component.AbstractInhabitantImpl.get(AbstractInhabitantImpl.java:78)
at com.sun.enterprise.v3.server.AppServerStartup.run(AppServerStartup.java:253)
at com.sun.enterprise.v3.server.AppServerStartup.doStart(AppServerStartup.java:145)
at com.sun.enterprise.v3.server.AppServerStartup.start(AppServerStartup.java:136)
at com.sun.enterprise.glassfish.bootstrap.GlassFishImpl.start(GlassFishImpl.java:79)
at com.sun.enterprise.glassfish.bootstrap.GlassFishDecorator.start(GlassFishDecorator.java:63)
at com.sun.enterprise.glassfish.bootstrap.osgi.OSGiGlassFishImpl.start(OSGiGlassFishImpl.java:69)
at com.sun.enterprise.glassfish.bootstrap.GlassFishMain$Launcher.launch(GlassFishMain.java:117)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.sun.enterprise.glassfish.bootstrap.GlassFishMain.main(GlassFishMain.java:97)
at com.sun.enterprise.glassfish.bootstrap.ASMain.main(ASMain.java:55)

Caused by: java.lang.NoSuchMethodException: No setter for property 'driverDelegateClass,' at org.quartz.impl.StdSchedulerFactory.setBeanProps(StdSchedulerFactory.java:1390) at org.quartz.impl.StdSchedulerFactory.instantiate(StdSchedulerFactory.java:872) ... 37 more |#]

please suggest what i am doing wrong here

Nathaniel Waisbrot
  • 23,261
  • 7
  • 71
  • 99
curious
  • 915
  • 4
  • 14
  • 27

1 Answers1

1

There is no property org.quartz.jobStore.driverDelegateClass for the RamJobStore. Also your properties file contains other incorrect properties for the kind of the Job store you are using:

org.quartz.jobStore.tablePrefix,
org.quartz.jobStore.driverDelegateClass,
org.quartz.jobStore.dataSource.

Why are they separated by comma? You are allowed to store quartz jobs in memory (by using RamJobStore) or persist to RDBMS (by using JobStoreTx). So first of all decide to yourself what kind of storage you need in your case. for each case examples are available on the quartz site.

Mike
  • 209
  • 1
  • 11