0

I developed an application using vaadin and quartz scheduler. I have this code :

final ServletContext servletContext = VaadinServlet.getCurrent().getServletContext();

StdSchedulerFactory stdSchedulerFactory = (StdSchedulerFactory) servletContext
            .getAttribute(QuartzInitializerListener.QUARTZ_FACTORY_KEY);
final Scheduler scheduler = stdSchedulerFactory.getScheduler();

So I notice that sometimes after the server reboot I have a java.lang.NullPointerException on this line stdSchedulerFactory.getScheduler()

Can you explain me what happen?

Willi Mentzel
  • 24,988
  • 16
  • 102
  • 110
Aniss
  • 29
  • 1
  • 1
  • 6

1 Answers1

0

The problem is in the way you initialize the scheduler.
I think someone had a similar problem (different error, but same usage).

//Create & start the scheduler.
        StdSchedulerFactory factory = new StdSchedulerFactory();
        factory.initialize(servletContext.getResourceAsStream("/WEB-INF/my_quartz.properties"));
        scheduler = factory.getScheduler();

Please take a look here for more details.

Community
  • 1
  • 1
AsafSavich
  • 613
  • 1
  • 10
  • 29