We are seeing an issue in multiple environments where Sitecron sometimes fails to initialize. In the log files, we see the following:
4072 16:16:03 INFO Initialize Sitecron 4072 16:16:10 ERROR Sitecron ERROR: Object reference not set to an instance of an object.
Unfortunately, Sitecron does not log a full stack trace, so it is difficult to know what is going wrong. Looking at the code, I can see that this must happen before it attempts to load job definition items from Sitecore. Otherwise, I would see additional messages in the log. Currently, it seems to me that either the call to
StdSchedulerFactory.GetDefaultScheduler() is returning
null or the exception is being thrown within that call.
We are on Sitecore 8.2 update 2. We started seeing this error while using Sitecron 1.1.6, but I just upgraded to the latest version 2.2 in the hopes that it would help. Unfortunately, I saw the error again as soon as I deployed to the dev server.
What could be causing this intermittent error?
Note that the error only happens occasionally. After the initial failure, I can get it to initialize by updating a job item or by calling the
ScheduleHelper.InitializeScheduler() via SPE.