当前位置: 首页 > 知识库问答 >
问题:

Quartz调度器在服务器启动时获取错误

柳胡媚
2023-03-14
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,']

我有quartz.properties文件,其中定义了如下RAM作业

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

我的课是

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();
    }

}

}

@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");

}
[#|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)

请指出我在这里做错了什么

共有1个答案

任小云
2023-03-14

RamJobStore没有属性org.quartz.jobstore.DriverDelegateClass。此外,对于正在使用的作业存储类型,您的属性文件包含其他不正确的属性:

tableprefix,
org.quartz.jobstore.driverdelegateClass,
org.quartz.jobstore.datasource。

为什么用逗号分隔?您可以将quartz作业存储在内存中(通过使用RamJobStore)或持久存储到RDBMS(通过使用JobStoreTx)。因此,首先,决定你自己需要什么样的存储在您的情况下。对于每种情况,可以在quartz网站上找到例子。

 类似资料:
  • 我将Tomcat server Version9.0配置为在Eclipse中运行。当我从Eclipse启动它时,它显示为在端口8080启动。当我尝试从浏览器或Eclipse内部访问位置Http://localhost:8080时,我得到Http错误404。如果我从命令行启动Tomcat服务器,它启动时也没有任何问题,但我不会得到404错误和页面显示正确。知道为什么会这样吗?谢谢

  • 我刚刚安装了Ruby193和Ruby200,在创建了一个新的应用程序之后,我正在尝试加载服务器,但是我得到了下面的错误。 我用gem'sqlite3'替换了sqlite3 gem,'~ 有人知道怎么修吗? Gemfile是 Bundle Show提供捆绑包中包含的宝石: actionmailer(3.2.13) actionpack(3.2.13) activemodel(3.2.13) acti

  • 问题内容: 我刚刚完成了重新安装操作系统的工作,并且像往常一样安装和测试了我使用的标准工具,现在当我尝试从eclipse启动Jboss 5时,出现了前所未有的错误: 以前有没有人遇到过类似的问题?到目前为止我从未遇到过 问题答案: 看起来像是JRE和OS版本的某些特定组合发生的错误(请参阅https://jira.jboss.org/jira/browse/JBAS-6981)。基本上,JBoss

  • 在启动节点管理器之后,当我要启动startWeblogic时。sh发生这种情况时,服务器无法启动。(用户名、密码正确) 以行开始WLS:home/app/oracle/java/jdk1.8.0_171/bin/java-server-Xms256m-Xmx512m-XX:CompileThreshold=8000-cp/home/12c/app/oracle/product/12.2.1/wls

  • 我使用CalendarTriggerImpl每3天触发我的作业。我的开始时间是2012-12-10 15:00:00,结束时间是2013-12-10。但是当我在2012-12-11 11:00:00执行我的计划程序时,作业会执行。如何解决这个问题。我没有使用cron触发器,因为它会在每个月重置。所以请帮助我在2012-12-10 15:00:00、2012-12-13 15:00:00、2012-

  • 我有一个新安装的wampserver2。5-Apache-2.4。9-Mysql-5.6。17-php5。5.12-64位。但当我点击wampserver时,它会变成橙色,无法启动。我检查了我的日志,我所有的apache、php和mysql日志似乎都是空的。浏览internet时,我发现运行以下命令C:\wamp\bin\apache\apache2。4.9\bin 有人能帮我解决这个问题吗?