Breaking News
Home / Java / Java Issues / Quartz Jobs fails- java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory

Quartz Jobs fails- java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory

Issue

Exception in thread “main”

java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory
     at org.quartz.impl.StdSchedulerFactory.<init>(StdSchedulerFactory.java:274)
     at org.quartz.impl.StdSchedulerFactory.getDefaultScheduler(…ulerFactory.java:1496)
     at <!>com.infuze.server.util.SchedulerManager.getScheduler(SchedulerManager.java:36)
     at com.infuze.server.util.SchedulerManager.scheduleJob(SchedulerManager.java:67)
     at com.infuze.server.util.SchedulerManager.scheduleJobs(SchedulerManager.java:47)
     at com.infuze.server.Startup.main(Startup.java:55)
Caused by: java.lang.ClassNotFoundException: org.slf4j.LoggerFactory
     at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
     at java.security.AccessController.doPrivileged(Native Method)
     at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
     at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
     at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
     at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
     … 6 more

Solution

Quartz framework uses SL4J (Simplied Logging for Java) for logging. When the Quartz engine initializes it searches for the factory class called as org.slf4j.LoggerFactory and if it is not found in the classpath, the job fails with the above error. Please make sure the classpath has the sl4j.jar or any other jar containing the SL4j classes. If not found, download it and add to classpath.

[pb_builder]

Check Also

Data truncation: Data too long for column – JDBC

Issue Caused by: com.mysql.jdbc.MysqlDataTruncation: Data truncation: Data too long for column ‘columname‘ at row 1     …

Leave a Reply