sheidaei sheidaei -4 years ago 138
Java Question

Quartz scheduler can not find plugin shutdownhook

I am running into this exception:

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)


It seems that Quartz can not find shutdownhook plugin. This has happened when I added the following line to the quartz.properties file for safe shutdown.

org.quartz.plugin.shutdownhook.cleanShutdown=TRUE


Any ideas how to add the shutdownhook to the quartz?

Answer Source

Before the following configuration line:

org.quartz.plugin.shutdownHook.cleanShutdown=TRUE

add the following line:

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

As suggested in the official quartz site (in the bottom of the page).

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download