quartz报错 org.quartz.impl.StdSchedulerFactory.
quartz任务执行报错
Exception in thread "main" java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory
at org.quartz.impl.StdSchedulerFactory.<init>(StdSchedulerFactory.java:284)
at init.QuartzManager.addJob(QuartzManager.java:28)
at init.ClearFileServerMain.run(ClearFileServerMain.java:13)
at init.AppMain.main(AppMain.java:30)
Caused by: java.lang.ClassNotFoundException: org.slf4j.LoggerFactory
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
... 4 more
对应带代码的scheduler工厂初始化报错
SchedulerFacroty sf = new StdSchedulerFactory()
查了好一会儿,这个问题是缺少jar包或者jar包冲突导致的。
需要下面两个包一起倒入 问题解决
quartz-2.2.3.jar
slf4j-api-1.7.5jar