Commits

Anonymous committed 4e0498c

QUARTZ-748 : StdSchedulerFactory throws NullPointerException when run from a Windows Service

git-svn-id: http://svn.opensymphony.com/svn/quartz/trunk@91469f7d36a-ea1c-0410-88ea-9fd03e4c9665

Comments (0)

Files changed (1)

src/java/org/quartz/impl/StdSchedulerFactory.java

     private Class loadClass(String className) throws ClassNotFoundException {
 
         try {
+            // work-around set context loader for windows-service started jvms (QUARTZ-748)
+            if(Thread.currentThread().getContextClassLoader() == null) {
+                Thread.currentThread().setContextClassLoader(getClass().getClassLoader());
+            }
             return Thread.currentThread().getContextClassLoader().loadClass(
                     className);
         } catch (ClassNotFoundException e) {