Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

java ClassNotFoundException LoggerFactory when setting Quartz up

So I'm using the Quartz jar: quartz-all-2.0.1.jar. From the readme, that jar is supposed to have everything set up. However, when I try to create a SchedulerFactory using

SchedulerFactory sf = new StdSchedulerFactory();

I get this:

Exception in thread "main" java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory
    at org.quartz.impl.StdSchedulerFactory.<init>(StdSchedulerFactory.java:268)
    at WebScraper.Main.main(Main.java:19)
Caused by: java.lang.ClassNotFoundException: org.slf4j.LoggerFactory
    at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:321)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:266)

I'm also confused because Eclipse does not show any errors before I try to run the program. Thanks for any help.

like image 258
Kevin Avatar asked Apr 26 '11 20:04

Kevin


1 Answers

The Simple Logging Facade for Java (SLF4J) documentation lists Quartz as depending on slf4j. You could download slf4j and add it to your classpath. I've no idea why it worked earlier without this issue.

like image 146
stacker Avatar answered Oct 13 '22 00:10

stacker