Quartz调度程序无法找到插件shutdownhook

时间:2013-08-13 20:01:48

标签: java quartz-scheduler scheduler

我遇到了这个例外:

org.quartz.SchedulerException: SchedulerPlugin class not specified for plugin 'shutdownhook'
    at org.quartz.impl.StdSchedulerFactory.instantiate(StdSchedulerFactory.java:984)
    at org.quartz.impl.StdSchedulerFactory.getScheduler(StdSchedulerFactory.java:1371)
    at org.quartz.ee.servlet.QuartzInitializerServlet.init(QuartzInitializerServlet.java:160)
    at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1139)
    at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:966)
    at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3996)
    at org.apache.catalina.core.StandardContext.start(StandardContext.java:4266)
    at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:760)
    at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:740)
    at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:544)
    at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:634)
    at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:561)
    at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:496)
    at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1203)
    at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:319)
    at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:120)
    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1022)
    at org.apache.catalina.core.StandardHost.start(StandardHost.java:736)
    at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1014)
    at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
    at org.apache.catalina.core.StandardService.start(StandardService.java:448)
    at org.apache.catalina.core.StandardServer.start(StandardServer.java:700)
    at org.apache.catalina.startup.Catalina.start(Catalina.java:552)
    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 org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:295)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:433)

似乎Quartz找不到shutdownhook插件。当我将以下行添加到quartz.properties文件以进行安全关闭时,就会发生这种情况。

org.quartz.plugin.shutdownhook.cleanShutdown=TRUE

如何将shutdownhook添加到石英?

1 个答案:

答案 0 :(得分:2)

在以下配置行之前:

org.quartz.plugin.shutdownHook.cleanShutdown=TRUE

添加以下行:

org.quartz.plugin.shutdownHook.class=org.quartz.plugins.management.ShutdownHookPlugin

官方石英网站(页面底部)的suggested