-
Notifications
You must be signed in to change notification settings - Fork 28
osgi.enroute.scheduler.simple.provider: NPE at startup when bundle with CronJob is started before scheduler bundle #70
Comments
Can you please provide a full stack trace? This may be a thread safety issue where one thread calls activate which writes the executor field while another thread calls after which reads the executor field. |
It is not a thread issue, simply the fact that SCR calls the addSchedule before the activate for any existing CronJog services at component activation time. (I should have stressed that I am using the whiteboard approach for scheduling services). |
Thanks for the stacktrace. There is definitely a bug in that the bind methods depend upon state set by the activate method. And the bind methods can be called before the activate method. |
At startup a NPE occurs in InterschedulerImpl at line 90 because the addSchedule method is called by SCR before the activate method.
A simple fix is to drop the activate method and initialize the ScheduledExecutorService at field declaration.
The text was updated successfully, but these errors were encountered: